Hi, I think we should consider make RSPEC-2189 detect do-while loop. Currently, SonarQube can only recognize for and while loop. Please review the sample below (a false negative):
public class Impl {
public void foo() {
int j = 0;
do {
j++;
} while(true); // should report a warning here
}
}
However, the following example can be detected:
public class Impl {
public void foo() {
int j = 0;
while(true) {
j++; // a warning reported here
}
}
}
Besides, my version:
- sonarqube-9.2.2.50622
- sonar-scanner-cli-4.6.2.2472-linux