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.