Quality gate passes on new code, although new code has issues

Must-share information (formatted with Markdown):

  • Version 7.9.5 (build 38598) - SonarQube Developer Edition
  • Q-Gate should fail, but it doesn’t
  • Reviewed Q-Gate rules, conditions.

Hi there,

I have custom quality gate configured. Triggered on PullRequests it should reject the pull request if there are issues on new code (and new code only). However the gate does pass, which is weird.

Analyzer does report: Errors on New Code … then it shows me the amount of issues. The rule says you can have 0 of those and the gate passes. Anyone got any ideas?



Hi @roman.gerteis

in fact, when I see your Quality Gate criteria, I don’t think anything specifically on “New Code”, except the New Bugs.
I’m surprised by the New Bugs that passed, but in any case, you should build your QG with metrics on New Code, if you really want to have 0 issues on New Code.

All in all, it would be easier to deal with the Ratings instead of the number of issues, as setting a threshold on number of issues can be a bit arbitrary.


Hi Carine,

thanks for getting back to me. I generally agree that quality ratings are better than an arbitrary fixed number of issues.

But anyhow I think my gate should have raised an issue and not let it pass.


Hi roman,

I’m going to start with some dumb questions.

You’ve shown a picture of the default Quality Gate. Can you verify that the project you’re showing used that QG on the analysis you’re showing? Also, just to be sure, that New Code condition on Bugs wasn’t added recently, was it? It’s been there the whole time?


9 posts were split to a new topic: Quality Gate passes even though there are new issues