Lines of Codes Miss Match

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): 8.6.1
  • what are you trying to achieve: Calculating Total Lines of Code
  • what have you tried so far to achieve this: Total Lines of Code miss match with License Manager Lines of Codes

Hello Team,

We have 2 portfolios:
1st portfolio have 4.5 M Lines of codes
2nd Portfolio total 12M Lines of Codes(this portfolio also include first portfolio)

we generate report on all project and total lines of code is showing 12M
License manager shows 16M

we are not able to find the Gap of these 4M Lines.

can advise please?


Hi Lalit,

For license purposes we count the largest branch of each project, which may or may not be the main branch that’s showing up in your Portfolio.

Unfortunately, there’s currently no easy way to identify where those extra lines of code are hiding.


Thank you for your reply Ann,

but currently we are not using Branch Analysis.
and we have pulled out all the projects with Lines of codes and total is 12M.
but License manager shows 16M.

can having 2 portfolios with same data increase the lines ?


Hi Lalit,

No, duplication in your portfolios won’t increase your LoC. Are you sure there’s no project with branches? Also, are you sure you have permissions to see every project? I’m not certain your view of a portfolio will reflect values from projects you don’t have access to.


Yes, i am admin of the sonarqube,
Also i have created a new portfolio having all the projects, we have total 1031 projects and that new portfolio contains all 1031 projects showing 12 M LOC.

i believe there is some problem with License Manager, may b bug in Sonarqube v8.6.1.

Thank you,

Hi Lalit,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.6.1 → 8.9.6 → 9.2.4 (last step optional)

However, I don’t think upgrading will address your issue. I believe you must have some large project branches you’re overlooking.


Thank you Ann,
Yes we are upgrading to 8.9.6 soon.
I found those missing lines, i have few projects which are not having main branch scanned,
And portfolio only calculates main branch LOC.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.