addLocation issue will remain when main issue file is excluded

I found an issue here:
when we set primary issue in file a.cpp and add a secondary location in b.cpp by addLocation(), secondary location will become a primary issue in Sonarqube UI if user set sonar.exclusion=a.cpp

is this by desgin? it will be great if there is some description about when we should use addLocation and add addFlow

Hi,

This is a great find. Thanks for reporting it!

Can you just verify that you’re using a current version of SonarQube before I pass this on?

 
Thx,
Ann

version 8.9

发自我的小米
在 G Ann Campbell via Sonar Community notifications@sonarcommunity.discoursemail.com,2023年11月20日 22:50写道:

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.9.10 → 9.9.3 → 10.3 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

 
Thx,
Ann

Hi Ann,
just upgraded Sonarqube to version 9.9.1, but still have the same issue

Hi,

Thanks for the followup. Can you share a few more details?

How are you setting locations? “addLocation()” looks like an API call, but we don’t support custom rules for C++. Are you maybe using the Cxx plugin?

 
Ann

yes, we are developing a plugin to parse a scaner report.

We used addFlow and AddLocation functions according to https://github.com/SonarSource/sonarqube/blob/branch-9.9/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/AbstractDefaultIssue.java

Hi,

Can you share the plugin code in question? Along with the test/reproducer code you’re rasing the issue on?

 
Thx,
Ann