Sort coverage information by uncovered lines or other criteria

Greetings,

In the SonarCloud page of my project, as I am trying to find the “low hanging fruit” of files/lines that aren’t covered yet, I can’t seem to find a way to sort the files per different criteria such as uncovered lines, uncovered conditions etc…

Is that something that is possible to do ?

Thanks in advance
Frederic

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    Github
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
    Github action
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
    Jave
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  • Potential workaround
1 Like

Hi Frederic,

We believe the best way to high coverage is to make sure the code you’re working on anyway has high coverage. Gradually and naturally, that will lead to high overall coverage.

But if you really want to do this, the Measures tab of your branch does the sort for you. Just expand the Coverage domain and check out Uncovered Lines or Uncovered Conditions. Switch the View to List, and you get a worst-first sort:

 
HTH,
Ann

2 Likes

Ann,

Indeed, I am following Sonar’s 80% coverage guideline for the code I am working on.
But as I am working on uncovered legacy code, I was willing to get the “worst-first” view of the whole code.

Thanks for your solution, it works great !
Regards,
Frederic

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.