Context
Your quality gate may be missing some conditions on the new code. Or having a very relaxed threshold. These can lead to a situation where quality gate status may give you a false sense of cleanliness. Gradually the technical debt in your overall code will creep up over time.
We made it easy to fix
Now you can navigate to your quality gate page and look for the option: Review and Fix this Quality Gate.
You will be able to review and understand what conditions will be added and what thresholds will be changed. As you fix your quality gate, SonarCloud will also offer the opportunity to remove redundant conditions that will no longer be needed.
Thatâs nice but because of the way that percentage based measures work, they rarely make sense to use with Gitlab on branches.
For example, if I deprecate 5 different methods and that is the only change in my MR, my âMaintainabilityâ rating will likely be an âEâ and I will be unable to merge that MR, even if my overall maintainability would still be an âAâ after merging that change.
Another example - if I make a 10 line change, and I want to only cover 5 of those lines - giving me 50% code coverage on new code - giving me a total code coverage on all of my code of 95%, my branch could still fail if I have a coverage goal of 80% on new code.
For maintainability issues that you may not want to address ânowâ but will fix later (such as deprecation), the current workflow is to âacceptâ those issues. This resolution will pass your quality gate.
They will no longer be visible on the main/master branch (existing code)
Accepted issues will not be visible in issue list pages by default - you can still see them by changing the âResolutionâ filter from âUnresolvedâ (default value) to âAcceptedâ. Moreover, SonarCould will display in the pull request and in each branch summary page the total number of accepted issues (see an example here) to help you quantify the technical debt.
They will no longer count towards my overall maintainability rating on existing code
Hi @Marco_Comi Thanks again for the discussion here, it is helpful.
I still have one point of confusion. In this thread Dismiss Issues Marked as âAcceptedâ - #9 by Marco_Comi we talked about accepted issues still having an impact on Technical debt (sqale_index ) or Maintainability rating (sqale_rating ), but in the reply above you stated that accepted issues will not count towards the overall maintainability rating.