org.sonar.l10n.java.rules.squid.S1994.html Maven / Gradle / Ivy
The newest version!
It is almost always an error when a for
loop's stop condition and incrementer don't act on the same variable. Even when it is not, it could confuse future maintainers of the code, and should be avoided.
Noncompliant Code Example
for (i = 0; i < 10; j++) { // Noncompliant
// ...
}
Compliant Solution
for (i = 0; i < 10; i++) {
// ...
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy