continue
is an unstructured control flow statement. It makes code less testable, less readable and less maintainable. Structured
control flow statements such as if
should be used instead.
Noncompliant code example
int i;
for (i = 0; i < 10; i++) {
if (i == 5) {
continue; /* Noncompliant */
}
printf("i = %d\n", i);
}
Compliant solution
int i;
for (i = 0; i < 10; i++) {
if (i != 5) {
printf("i = %d\n", i);
}
}