COBOL: Packed numeric fields should be defined with odd length false positive

cobol
sonarlint
sonarqube

(Sam Fox) #1

This ticket is created in response to my comment here:
https://jira.sonarsource.com/browse/RSPEC-3945

This rule (Packed numeric fields should be defined with odd length) seems to be incorrectly flagging the following:

10 BENE-GROSS-WK-AMT PIC S9(9)V9(2) COMP-3
OCCURS 010 TIMES.

We believe this is due to “OCCURS 10 TIMES” which might inadvertently tripping the even check.


(Christophe Zurn) #3

Hello Sam,

Thank you for your feedback. Indeed, this is a false positive. The rule incorrectly checks the full size of the table/array in this case, instead of checking the size of the individual elements.
I created a ticket to take care of the problem: SONARCOBOL-1538

Best,

– Chris