21 lines
322 B
Plaintext
21 lines
322 B
Plaintext
![]() |
include::../description.adoc[]
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
for (var i = 0; i < 10; i++) {
|
||
|
...
|
||
|
i = i - 1; // Noncompliant
|
||
|
...
|
||
|
}
|
||
|
|
||
|
for (var i = 0; i < getMaximumNumber(); i++) {...}
|
||
|
----
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
----
|
||
|
int stopCondition = getMaximumNumber();
|
||
|
for (var i = 0; i < stopCondition; i++) {...}
|
||
|
----
|