Details

    • 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

      Description

      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);
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Anonymous
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: