Project size not showing when no main branch analysis

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 10.4.1 DE (docker)

  • what are you trying to achieve
    Sort projets by LOC size


We are slowly reaching our Developer edition licence limit and trying to understand recent growth in licence LOC consumption.

While browsing the main page or our SQ server, when sorting projects by “size”, we see that many projects don’t have a size info.

This seems related to the fact that such project, relying on sonar-scanner for both creation and analysis, have several branches analysis but none of those are considered MAIN branch analysis.

As SQ computes project LOC consumption by taking the “biggest” branch analysis size, we could expect that such size info would be made available even when no MAIN branch analysis exist.

Is it a known issue? A limitation due to our usage?

Thanks in advance for your advices

Note: api api/projects/license_usage works fine and provide missing data


The License LOC used by a project won’t necessarily correspond to what shows up on the Projects page anyway. As you’ve noted, for license usage, we count the largest branch (or PR) of a project, and that may or may not be main, which is what’s shown on the Projects page. And for projects where no main branch has been analyzed, well… that means nothing on the Projects page.

To track this down, take a look at the api/projects/license_usage web service. You’ll find a link to the API docs in your SonarQube page footer.