FP on cobol:S3921 when accessing an array of which the size is defined by a 78-level field

We are scanning Acucobol sources.
When a program contains an array of which the size is defined with a 78-level variable,
the size of the array is not calculated correctly. The value of the OCCURS clause is taken as 1.
When directly using a number in the OCCURS clause there is no problem.
See the example program below:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. PP0044.
       WORKING-STORAGE SECTION.
       78  ARRAY-SIZE VALUE 5.
       01  ARRAY.
           03  ARRAY-ELEMENT  PIC X(01) OCCURS ARRAY-SIZE.
       PROCEDURE DIVISION.
       MAIN SECTION.
           MOVE "ABC" TO ARRAY
           GOBACK
           .

Versions used:
Cobol: Acucobol 10.2.1
SonarQube: * 10.2.1 (build 78527)
SonarScanner 5.0.1.3006

Please fix this FP.

This is indeed a problem in our analyzer.
I created SONARCOBOL-1690 to track it.

Thanks a lot for your feedback and the short reproducer!

Hi Pierre-Yves,

Although we have not seen a solution posted for this issue, we see that it no longer occurs in SQ 10.4
Maybe it was fixed as a side-effect of another fix?

Hi Jos,

Sorry for the late reply.
What makes you think that this false positive is fixed in SQ 10.4?
According to my tests, it’s still there.

Pierre-Yves,

You are right.
A collegue switched off the rule, without me knowing about it.
This lead to a wrong conclusion.
I apologise for the confusion and inconvenience caused.

Kind regards,

Jos Abrahams