CRITICAL
Rule Definition
Unreferenced code 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
Remediation
Verify that the unreferenced file disks are not dead code. If it is the case remove it. If it is not the case, report it to the CAST administrator.
Violation Code Sample
Sample1: File Disk defined in a Program.
FDISK_NAME1IF E K DISK rename(REC1:RECORD1)
FDISK_NAME2IF E K DISK rename(REC2:RECORD2)
C OPEN(E) DISK_NAME1
C *LOVAL SETLL RECORD1
Sample2: File Disk defined in a Copy Member included by a Program.
COPY1
FDISK_NAME1IF E K DISK rename(REC1:RECORD1)
COPY2
FDISK_NAME2IF E K DISK rename(REC2:RECORD2)
PGM1
/COPY COPYSRC,COPY1
/COPY COPYSRC,COPY2
C OPEN(E) DISK_NAME1
C *LOVAL SETLL RECORD1
Fixed Code Sample
Sample1: File Disk defined in a Program.
FDISK_NAME1IF E K DISK rename(REC1:RECORD1)
FDISK_NAME2IF E K DISK rename(REC2:RECORD2)
C OPEN(E) DISK_NAME1
C *LOVAL SETLL RECORD1
C OPEN(E) DISK_NAME2
C *LOVAL SETLL RECORD2
Sample2: File Disk defined in a Copy Member included by a Program.
COPY1
FDISK_NAME1IF E K DISK rename(REC1:RECORD1)
COPY2
FDISK_NAME2IF E K DISK rename(REC2:RECORD2)
PGM1
/COPY COPYSRC,COPY1
/COPY COPYSRC,COPY2
C OPEN(E) DISK_NAME1
C *LOVAL SETLL RECORD1
C OPEN(E) DISK_NAME2
C *LOVAL SETLL RECORD2
Related Technologies
Technical Criterion
Dead code (static)
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.