Sonarquebe Custom Plugin: Is there a way to automatically set resolutions in sonar scan?


We’d like to automatically set the resolution of the issues found during a sonar scan, is there a way to achieve that?

I have checked the current reportIssue and reportIssueWithFlows, which seems not being able to do that, if I understand right.

Could you please suggest? Thank you!

Our environment is:

Sonarqube 7.7

There is no way to set issue resolution at analysis time, I am curious of the use case you are trying to achieve if you want to resolve all issues raised.
Can you please explain a bit more your use case ?

Hi Alex,
Thank you, that\s a pity, sure, we have a custom plugin, which will help mark some potential prohibited code lines, but there are cases that some are identified as false positivies with a particular probability.

Our current way is to manually mark those false positivies from UI, but this is not convenient and tedious. Thus asking for a solution at analysisi time.

Hope this will be added some time in the future:-)

Why would you raise the issue in the first place if it’s a false positive?

actually during analysis, it’s hard to tell if this is a false positive or not, but we can add a ratio to mark those that we think they are probably false positive. this we can do in the code. we can then manually check on UI aftwards. So we\d like to be able to set a resolution when reportIssue from code.