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


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 :


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


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


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?


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

The current version is :

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.