Essential complexity

Essential complexity is a measurement developed by Thomas McCabe to determine how well a program is structured. It measures the number of entry points, termination points, and nondeductible nodes. The closer to 1 this value is, the more well structured the program is.

Rational® Asset Analyzer produces an approximate measurement of Essential complexity for COBOL and PL/I programs using the following formula:

ESSCOM = ( NONREDUC + 1 ) + ( ENTRYPT - 1 ) + ( TERMPT - 1 )

Read this equation as "Essential complexity is the sum of nonreducible nodes plus one, plus one for each entry point after the first, plus one for each termination point after the first."

In Rational Asset Analyzer, the terms of the formula are defined as follows:

Nonreducible nodes
Splitting nodes in a context that indicates unstructured programming constructs. The nodes are called nonreducible when they cannot be separated from the decision or loop that they make unstructured. Rational Asset Analyzer classifies the following statements as nonreducible nodes:
      4008 ENTRY
      4607 RETURN
      4629 TERMINATE
      4634 ALTER
      4635 EXIT PROGRAM
      4636 GOBACK
      4637 STOP RUN
      5012 PL/I ENTRY
      5013 PL/I EXIT
      5037 PL/I STOP
      8001 EXEC CICS ABEND
      8055 EXEC CICS HANDLE ABEND
      8056 EXEC CICS HANDLE AID
      8057 EXEC CICS HANDLE CONDITION
      8085 EXEC CICS LINK
      8107 EXEC CICS RETURN
      8160 EXEC CICS XCTL
      
Entry points
Reserved words that indicate the transfer of control into the compilation unit.
Termination points
Reserved words that transfer control out of the compilation unit without provision for return of control. Rational Asset Analyzer classifies the following statements as termination points:
      4635 EXIT PROGRAM
      4636 GOBACK
      4637 STOP RUN
      5013 PL/I EXIT
      5037 PL/I STOP
      8001 EXEC CICS ABEND
      8107 EXEC CICS RETURN
      8160 EXEC CICS XCTL