Problem with rule cobol:COBOL.GotoTransferControlOutsideCurrentModuleCheck

SonarQube 7.9.1 LTS

There seems to be some problem with this rule - cobol:COBOL.GotoTransferControlOutsideCurrentModuleCheck

It does not catch all the issues on a cobol file in one run. Subsequent runs on same source code keeps on producing (and even fixing) issues from this rule. Thus breaking the SonarQube’s “New code” feature.

Can you please provide a small reproducer? Ideally, it should show:

  • the initial COBOL code where an issue is raised and where you expect other issues
  • the COBOL code after the first issue is fixed

That would help us to understand your problem.


@pynicolas Uploading the sample code here. (2.1 KB)

Here are the results of scan on this code:

CblFile1.cbl -> CpyFile1.cpy -> CpyFile2.cpy

Notice that CpyFile2.cpy reports only 1 GoTo related issue at line 75 of CblFile1.cbl. However, same module (88500-HANDLE-DB2-RTN-CD) is also called on lines 51 and 90 of same CblFile1.cbl. Those 2 issues are not being reported.

The bigger problem however is that now during subsequent runs and without making any code changes in these 3 files, the issues at line 51 and 90 might come up and be shown as coming in “New code”. That’s where the new code feature of SonarQube fails.