Lines of Code in Project Information shows the largest branch

Hi everyone, I hope this is a correct category.

From SonarQube docs:

The LOCs that are counted are those found on the largest branch of the project.

Currently when you go to the Project Information page you will see the count of Lines of Code for Main branch, however it might be not the biggest branch of the project. Sometimes this is confusing as the api/projects/license_usage (I think I used this one a while ago) will return 0 for the main branch when on the feature branch there will be 2 millions LoC.

It would be nice to see the number for largest branch which will be accounted to LoC License usage when you go to the Project Information on UI site. And of course the API could return the number for the largest branch and not the main branch. (I used the API a couple months ago and might be wrong about it)

Kind regards,

Sasha

Hey @oleksandrmiti, GET api/projects/license_usage returns the LOC in each project’s largest branch/PR, not in the main branch. This is documented under <your_url>/web_api/api/projects/license_usage. Perhaps you were using a different API?

Regardless, I do hear your feedback that the project information page only shows the main branch and not the largest. It could be interesting to consider such a feature, so I will flag this for our PMs.