Rule Definition
Unreferenced Sections and Paragraph may be the symptom of Dead Code. Dead Code must be avoided as it makes source code less readable and increases the cost of the software maintenance.
Warning:
Unreferenced code can also be the symptoms of missing code (code not included in the source code analysis).
Remediation
Check if the Artifact is truly unnecessary. Then remove Artifacts that are not used.
Violation Code Sample
PROCEDURE DIVISION.
* Called by PROCEDURE DIVISION
MAIN SECTION.
PROCESS.
PERFORM PROC-01.
PERFORM PROC-02 THRU PROC-04.
IF A > 2 THEN
GO TO PROC-7.
END-IF
* Called by fall thru and PROC-8 (GOTO)
END-PROCESS.
GOBACK.
* Called by PROCESS (PERFORM)
PROC-01.
IF A = 10 THEN
PERFORM PROC-06
END-IF
* Called by PROCESS (PERFORM THRU)
PROC-02.
MOVE 1 TO A.
* Called by PROCESS (FALL THRU)
PROC-03.
ADD 5 TO A.
* Called by PROCESS (FALL THRU)
PROC-04.
EXIT.
**** This paragraph is never called
PROC-05.
MOVE "PGM02" TO PGM-NAME.
* Called by PROC-01 (PERFORM)
PROC-06.
MOVE "PGM" TO PGM-NAME.
* Called by PROCESS (GOTO)
PROC-7.
IF A > 2 THEN
MOVE 0 TO A.
END-IF
* Called by fall thru
PROC-8.
GO TO END-PROCESS.
Related Technologies
Cobol
Technical Criterion
CWE-561 - Dead Code
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.