FP on rule S1728 when indenting 88-level condition names

Hi Pierre Yves,

Sorry to come back on an already closed issue.
I was checking up on which issues I reported are fixed, and which ones aren’t.

When I looked at SONARCOBOL-1675 I noticed that in hindsight I don’t agree with the way 88-level condition-names are handled now with respect to S1728:
I can of course agree that all 88-levels of a field should be aligned the same way, but I do not agree that the name of the condition should be aligned with the name of the field, nor should the ‘88’ be aligned with the level that the condition applies to.
That will in my opinion not improve readability.
The way I see it the demo program that I supplied with this issue (see below) should not trigger any issues with S1728.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. PP0041.
       WORKING-STORAGE SECTION.
       01 FIELD-1-LEVEL-01           PIC X(01).
          88 FIELD-1-CONDITION-NAME  VALUE "Y" FALSE "N".
       78 CONSTANT-78-LEVEL          VALUE "Constant".
       PROCEDURE DIVISION.
           IF FIELD-1-CONDITION-NAME
              DISPLAY CONSTANT-78-LEVEL
           END-IF
           GOBACK
           .

Can you please share your opinion on this?

With kind regards,

Jos Abrahams

Hi Jos,

Which version of SonarQube are you using?
When I analyze the example you gave with SonarQube 10.3, I don’t get any issues.

Pierre-Yves

Hi Pierre-Yves,

My apologies for not reporting our SQ version in the first place.
We are currently using 10.2.1, so I will ask the team to upgrade to 10.3.
Once that is done I will check, and report back to you.

image001.gif

image002.gif

Hi Pierre-Yves,

We have finally installed a newer version (10.4), and the issue is resolved.
So you were right, as usual.

Regards,
Jos Abrahams

2 Likes