Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-11283

Quality Gate should not fail when too few lines to cover



    • Edition:
    • Production Notes:


      There are still some cases when it's not possible to prevent the Quality Gate from being red because of coverage on new code.

      This is the case when changes implies a few few lines of code that can be tested:

      • Changes add/update more than 20 lines of code, but only a few of them are lines to be covered.
      • If among those few lines to be covered, half of them only can be covered, coverage on new code can't be good enough and the Qauloity Gate is red.

      Today, we have a minimum number of new lines (20) under which the conditions on duplication-related and coverage-related metrics (on new code) are ignored when computing the QG.

      Instead of considering the number of lines, conditions on coverage-related metrics should be ignored based a minimum number of new lines to cover.
      The threshold will also be 20.

      In the case happens, the message next to the quality gate status remains the same:

      Some Quality Gate conditions on New Code were ignored because of the small number of New Lines

      The longer explanation will be updated:

      At the start of a new code period, if very few lines have been added or modified, it might be difficult to reach the desired level of code coverage or duplications. To prevent Quality Gate failure when there's little that can be done about it, Quality Gate conditions about duplications in new code and coverage on new code are ignored until the number of new lines and new lines to cover is at least 20


          Issue Links



              Unassigned Unassigned
              christophe.levis Christophe Levis
              6 Vote for this issue
              6 Start watching this issue