Wrong analysis : "BINARY" variables should be used to declare variable-length table sizes (cobol:S3671)

Hi,

I’m using SonarLint in an Eclipse Neon on a Cobol program and I get the error in the title on these lines of code :

2020-09-08_16h00_01

The error doesn’t match the code and when the COMP variable is moved before the table declaration the error disappear :

2020-09-08_15h58_25

It looks like the variable type is not taken into account when it’s placed after the table declaration.

Hi,

Sorry, I cannot reproduce the issue.
Would it be possible, by any chance, that you added the “comp-5” clause and didn’t save the file in Eclipse? That’s the only scenario I can think of…

Otherwise, can you please specify which version of the sonar-cobol-plugin is installed on your SonarQube server?

Hi,

No the “comp-5” clause was already there in the file.

The current version is : 7.2.0.13530

Thanks.
I can indeed reproduce the problem with SonarQube 7.2.
It seems this issue was fixed when fixing another false positive on the same rule.
Please upgrade to a newer version.