Set line coverage as criteria on coverage metric in quality gate

How do I test for line coverage and not branch coverage on new code? We are using SonarQube Server v9.9.8 (build 100196).

When I edit the Quality Gate, I can only set the value, but not the actual metric :thinking:

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

9.9.8 → 2025.1.2-> 2025.3 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, if you want to include line coverage in your Quality Gate, you’ll need to add a new condition. Once you do that, you’ll be able to choose the metric.

 
HTH,
Ann

Thank you, Ann. We are working on it :grinning_face_with_smiling_eyes:

For anyone else with this issue and on this very old version, I found a solution:

  1. Create a new quality gate
  2. Unlock editing
  3. Add condition
  4. Choose Line Coverage: