Parse error closes all open issues

SonarQube 7.9.1 LTS Enterprise
SonarCobol 4.4

Scenario - There is a COBOL file with several issues identified by SonarQube. At a later date some code changes are made, which leads to a parse error during sonar scanner execution. Now, because of parse error ALL open issues in the COBOL file gets closed automatically. I am not sure if this is how it should work. I would expect SonarQube to just exclude the file from analysis when it finds a parse error (assuming the file did not change).

Problem with current implementation is that when parse error gets fixed in code, SonarQube treats all “existing” issues as “New” and this fails the existing debt logic.

Can this be handled within SonarQube such that parse errors do not close the existing issues ?

1 Like

Hi,

What’s the time period between the issues being closed and the parse error being fixed? If it’s within 30 days the old issues should be re-opened.

Also, please do report parse errors to us so we can address them. :slight_smile:

 
Ann

1 Like

That’s not the behavior I see. It all happened within 7 days. On Aug 21, parse error was detected in cobol file which closed all existing issues. On Aug 26th, the parse error was fixed in code, which led to NEW issues being created for the same file.

1 Like

I can share the parse error reported by Jenkins scanner if you can send me a private message.

Hey there.

In earlier versions of SonarQube v7.9 LTS there were some issues with issue tracking on COBOL in some situations. These tickets describe some of the cases that got fixed in later versions of SonarQube v7.9 LTS.

SONAR-12449 Issue tracking is missing random issues moved to other lines
SONAR-12927 Moved File Detection doesn’t work for Cobol

The latest version of the LTS is SonarQube v7.9.4 – so I would suggest you upgrade and see if you can reproduce the issue.

Were these files checked into an SCM (like Git)?

1 Like

I have viewed both tickets, I don’t think any of them would fix the problem that I am facing (i.e. parse error closed all existing issues). This is not a random issue, parse error “always” closes all existing issues in that file.

And yes, files exist in Git.