Determine projects with largest number of lines of code on an SonarQube instance

  • Community Edition Version 7.9.4


Is it possible to find out via the web api, querying the DB or from UI, which projects have the most lines of code.


Hi @pcar ,

The fastest way is to sort the projects on the projects dashboard by clicking on “Sort by” drop down box and clicking on “Size” and change the order to descending:

Then look on the right-hand size and look for “Lines” section of each project.

If you want finer grain detail, you will need to Web API to find all project keys and get each project’s ncloc metric. Example:

curl -u <INSERT-USER-TOKEN>: -X GET '<INSER-SONARQUBE-HOST>/api/measures/component?component=<INSERT-PROJECT-KEY>&metricKeys=ncloc'