Reaching your Lines of Code limit - how to find out which project?

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): * Version 10.2 (build 77647)
  • how is SonarQube deployed: zip
  • what are you trying to achieve: find out which project has the largest lines of code
  • what have you tried so far to achieve this: check SonarQube but could not find out

We are getting the following info in the license manager:

455,726 lines currently analyzed500k

In order to determine how much each project contributes, the license takes into account the number of lines of code on the largest branch of that project. Lines of test code do not count towards your license usage.

You have almost reached your lines of code limit. Please contact SonarSource to increase the threshold.

But, it does not tell us which project is the culprit (from SonarQube perspective). As I check all our projects, none has the lines of code that is close to indication above.

How could we tell which exactly which project thar SonarQube complains? I mean: from within SonarQube, in the eyes of SonarQube.

Be aware of the comment about the largest branch.
So this doesn’t have to be master/main. It could be some old branch.
Check each projects and use the dropdown to see which branches are in SQ.

If you really can’t find it, you could reduce the time branches are kept before cleanup.


Take a look at the api/projects/license_usage call. @SierraNL makes the excellent point that it may not be the main branch that’s the largest on a project. The API call gives you usage per project and which branch is the largest for each project.


Oh well… very interesting, until just now, I was under the impression the calculation of LOC is looking at the largest project ONLY.

But I just check again, it is actually looking at ALL the projects:

That explains it.

And the API call does help to clarify the usage. Thanks.

1 Like