0

I recently used sonarqube api to create a dynamic quality gate, it increases or decreases the acceptable number for the project, according to the number of lines of code, but I'm having some problems ...

It works like this, after the analysis I use the number of lines and calculate the quality gate to increase or lower the acceptable limit

I use the sonar line count itself to avoid mismatching information, but whenever I update a quality gate, the project status is not updated.

For example, if a project was with the quality gate with the status "Passed", after I update the quality gate, it should change the status to "Failed", but it remains "Passed" because I did not perform a new analysis.

How can I request pro sonar to re-execute the project status according to the quality gate change?

I'm using sonarqube 6.0

Thanks

1 Answers1

0

You have no choice but to re-run an analysis if you want your quality gate to be updated.

Just as a side note: it looks like you are trying to hack SonarQube features, I would not recommend to go into that way because you will for sure face problems. Instead, I highly encourage you to read "Water Leak Changes the Game for Technical Debt Management" and consider using the built-in quality gate that puts the focus on new code: this is the best and easiest way to improve code quality over-time with almost no effort and no friction.

  • found it, thanks! https://blog.sonarsource.com/water-leak-changes-the-game-for-technical-debt-management/ – Bruno Henrique Jan 30 '18 at 12:20
  • I liked the approach of only worrying about the new code, I believe that with this gradually the old development will suit the rules of quality. However, if a quality gate is set to not have new issues of blocker and critical levels, this would suit me, but with regard to major and minor notes, it would not be a very drastic attitude to fail a quality gate by some indication among these severities? I thought about setting up some static number to use a general quality gate for all projects, but since they have distinct sizes, I think that would be unfair. Thanks again for the help. – Bruno Henrique Jan 31 '18 at 11:16