0

I'm using SonarQube 4.2.1 for analyzing maven projects and I'd like to fail the quality gate when the number of issues is higher than the last successful analysis (QG was green).

I'm aware of Fail SonarQube quality gate when coverage decreases but it does not cover all my needs, because the QG would be green also, when build #1 has 5 issues (with QG green), build #2 8 issues and build #3 has 7 issues, which is less than the last analysis but still more than last successful build #1.

Any idea how to do this?

Community
  • 1
  • 1
Frank
  • 741
  • 1
  • 10
  • 24

1 Answers1

0

You just have to add the following condition:

  • Metric: "New issues"
  • Delta since previous analysis
  • "Is greater than"
  • "0" in error
  • Well, this does not work. When I configure a QG like this and run three builds like that:
    #1 1 issue -> green
    #2 3 issues -> red
    #3 2 issues -> green

    This is not my goal, the QG should be green after having 1 or less issues again.
    – Frank Feb 13 '15 at 12:46