Duplicated lines of code in license manager

We are using LTS 8.9.1 and have about 500k+ lines of code that is being analyzed.

During the summer I discovered that the license manager tells us to our license for 1mn lines of code is not enough so obviously there are projects being duplicated in the count.

We have different portfolios containing the a mix of projects, could that be the course for the duplication ? Eg, same project exists in different portfolios and not in a setup of sub-portfolios ?


Welcome to the community!

No. License LoC are based on projects, not portfolios. When you say you have ~500k LoC, what are you basing that on? If it’s the LoC shown on the Projects page, that’s probably the source of the confusion.

SonarQube uses the largest branch of each project for license purposes. If you have a project where the main branch is 80k and the Develop branch is 100k, that project uses 100k of your license.

I know this isn’t easy to see in SonarQube right now. We may work on that in the 9-series but we haven’t decided yet. Please vote & comment if this is important to you.


Thank you for your fast reply, then I can scratch portfolios of my list.
As to your question, when i look at the projects page and count all the code I end up with something like 550 k LOC and the license manager states that we are currently using 995k LOC.

My next thought would be to do a full reindex by deleting the contents of the data-dir and start the service again.


As I said,

So summing the LoC counts shown on the projects page isn’t going to get you your true license LoC.

Unfortunately, you have a painful task ahead of you. For every project you need to check each branch. Find the branch with the largest LoC number and that’s what you’ll add to your running sum. This is how you’ll find where your License LoC is going.

That’s really not going to help.


Thank you Ann for your help, you were absolutely correct and we did find the missing LOC’s in other branches.

1 Like