Keeping Status Consistent for Recurring Hotspots and Issues

Hello Sonar Community,

We have a question regarding the handling of repeated Security Hotspots and Security Issues in SonarQube.

We have noticed that the same rules keep appearing again in the code when similar changes are introduced, even though they were previously reviewed and marked as Safe or Acknowledged.

We are aware that rules can be disabled via a custom Quality Profile, but this is not our goal. We want to keep the rules active while avoiding the need to repeatedly mark similar findings with the same status.

Is there any way to persist the status or decision (e.g., Safe or Acknowledged) for similar findings when they appear again within the project?

Additionally, could this use case be handled using sonar.issue.ignore.multicriteria, or is that approach not suitable for Security Hotspots and similar repeated findings?

Our goal is to avoid repeated manual reviews for the same type of finding, especially when the team has already decided how to handle it or plans to address it later, so it does not continuously block PR merges.

Is this behavior supported, or is there any recommended workaround?

Regards,

Eman

Hi Eman,

SonarQube doesn’t “learn” from issues you’ve marked safe.

This exclusion type allows you to pair rule keys and file path patterns, so you could keep the rule in your profile, but prevent it from being applied on certain file paths. Perhaps that would help?

 
Ann

Hello Ann,

Thank you for your response.

Yes, this could be a good workaround. I just wanted to confirm whether this configuration (sonar.issue.ignore.multicriteria) applies to both Security Hotspots and Security Issues, or only to issues?

Thanks.

Hi,

Not to be pedantic, but it actually applies to rules, from which come both Issues and Security Hotspots. So yes, this should work. And it makes sense why you were uncertain.

 
:slight_smile:
Ann

Hi,

Yeah lol, I probably should’ve concluded that without asking as I’m testing this configuration.
Thanks for the clarification, Ann really helpful.

Regards,

Eman