How are "accepted" and "false positive" issues counted in quality gate conditions?

Hi all,

With SonarQube Enterprise v10 running in docker, I am trying to understand how issues that are marked as “false positive” or “accepted” are counted towards the “total issues” and “new issues” metrics in a quality gate. The ultimate goal is to understand how reviewing issues - and setting their state accordingly - plays together with the quality gate conditions.

Simply put: Will a new issue marked as “accepted” or as “false positive” make the Sonar Way quality gate (with the condition that new code has 0 issues) fail, or will it pass because it is not “open”?

Follow up question: If new issues in “accepted” or “false positive” state violates the “new code has 0 issues” condition, is there a way to implement a quality gate conditions that requires that “new code has 0 open issues”.

Homework: I was expecting an answer from e.g. Issues (sonarsource.com) and metric definition (sonarsource.com), but found no answer. However I found that the open_issues metric is deprecated (there is no new_open_issues), suggesting to me that I’m thinking about this the wrong way. What might be the right way? :slight_smile:

Hi,

Welcome to the community!

Accepting an issue or marking it False Positive removes it from “Open”. So, for instance, if your Quality Gate is failing because of 1 new issue, and you Accept that issue, then your QG will be automatically re-evaluated and set to passing.

 
HTH,
Ann

Hi Ann,

Welcome to the community!

Thanks :slight_smile: and thanks for a swift response!

That seems like the way to go them :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.