-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:Remove this "continue" statement.
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Default Quality Profiles:Sonar way
-
Legacy Key:ContinueUsage, ContinueStatement,ExitInLoop
-
Covered Languages:C, C++, JavaScript, Objective-C, PL/SQL
-
Remediation Function:Constant/Issue
-
Constant Cost:1h
-
ESLint:no-continue
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); } }
1.
|
JavaScript | RSPEC-2746 |
|
Active | Unassigned | |
2.
|
PL/SQL: "EXIT" should not be used in loops | RSPEC-2462 |
|
Active | Unassigned | |
3.
|
C-Family | RSPEC-3943 |
|
Active | Unassigned |