Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity
    • Legacy Key:
      COBOL.IfStatementNestedUsageCheck

      Description

      Nesting too many control flow statements (such as IF, PERFORM, EVALUATE...) should be avoided as it makes the code complex and therefore difficult to maintain.

      Noncompliant Code Example

      With a threshold (maximum allowed control flow statement nesting depth) of 3:

      IF A = 1
          PERFORM 
              MOVE A TO B
              PERFORM
                  IF B = 1 *> Noncompliant
                    MOVE "HI" TO S1  
                  END-IF
              END-PERFORM
          END-PERFORM
      END-IF.
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ann.campbell.2 Ann Campbell
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: