We are trying to analyse Cobol sources.
When there is a FILLER with level 01 in the PROCEDURE DIVISION, and this FILLER has associated 88-level condition-names, the analyzer generates a code-smell warning that the name of the condition should start with ‘FIL’.
Although we generally also consider it good practice to have the condition-names start with the name of the variable, we think an exception should be made for ‘FILLER’:
- A (01 level) FILLER can only be referenced through the condition-names.
Having these all start with ‘FIL’ is in no way going to make things more clear. - Complying with this rule will only result in more typing, and there will be no distinction between the
various fillers that all may have 88-level condition names, all starting with ‘FIL’.
Versions used:
Cobol: AcuCobol version 10.2.1, fixed format
SonarQube: Enterprise Edition Version 9.6.1 (build 59531)
Source code:
IDENTIFICATION DIVISION.
PROGRAM-ID. PP0038.
WORKING-STORAGE SECTION.
01 FILLER PIC X(01).
88 VEHICLE-CAR VALUE "C".
PROCEDURE DIVISION.
MAIN SECTION.
IF VEHICLE-CAR
DISPLAY "CAR"
END-IF
GOBACK
.
This results in the following issue:
We think this is undesirable.