LOC Computation during project setup

I am trying to setup a new project (32.6k LOC size) , which gives the following error:

This analysis will make your organization ‘XXX’ to reach the maximum allowed lines limit (having 130179 lines).

Our repo size is 32.6k LOC , I am not sure why it can not scan as its within current plan of 100k LOC limit (the other projects have not been scanned since Jan’ 21).

From the billing page for organization, I have seen this information:
64,389 private lines of code analyzed [over 22 projects]

And I am adding a project with repo size 32.6k LOC …
Since there is no scanning done for any project since last 6 months, would it consider those during the new project setup ? If not, why its giving error with (having 130179 lines).**

what are my options here to resolve this error ? We can upgrade to next level , but i really want to understand how it computes the LOCs for subscription licensing ?

Thanks in advance

Hi @nshukla-spbike ,

Based on the information you share, the analysis you ran came to have 130,179 - 64,389 = 65,790 lines of code, so about twice as much compared to your estimate of 32.6k lines of code.

I would therefore propose to understand where this difference is coming from.

  • Could you share how you get to the 32.6k LOC number, and what file types you account for?
  • You may want to check not only the source files in your repository, but also the outputs of your build process (e.g. XML/HTML outputs) that may be picked up by the scanner
  • To get into the details, you may want to run the scanner, activating the debug mode. This way, you should get a trace of all files that were accounted (also which files are excluded) in the analysis and reconcile with your desired scope (look up the documentation pages for scanners about how to do this).

I hope this helps - let me know!

1 Like

Thanks @AlxO . Since I was not able to figure out the issue, I deleted most of the old projects (in any case, they were not scanned for more than 6 months) and it was able to do the analysis (its enabled for PR as well). At the same time, since the project codebase is growing fast than expected, I am sure we might hit the issue again at the same point.

I used GLOC, CLOC , and some other handy tools to get the initial LOC estimate… I would like to learn more about debugging process for scanners so would check out the documentation.

Would keep you posted.


1 Like

Hi @nshukla-spbike ,

I am glad to know you were able to analyze your project. Now that it is analyzed, you should be able to browse it in :sonarcloud: and see where lines of codes are using the “Code” tab.


You can see the LOC breakdown per language on the project’s main summary page, or in more detail by going to Measures / Size / Lines of Code, for example:

Yes @AlxO . After the project analysis, there is more visibility to LOC etc… It was working for 2 weeks with SUCCESS for dev branch and new PRs… Since the code is growing fast, since last night , I see the same problem of analysis not successful (This analysis will make your organization XXXX to reach the maximum allowed lines limit (having 101371 lines).
In last successful analysis, the breakdown is shown as:
Main Page : 75K LOC (JavaScript : 51 K , CSS 24K).
And then checking the details, I could see :
new lines:10,634 …Comments % (8.8%) etc .Can I disable/exclude comments ?

I will go over the repo to validate if there are any output files though I do not think so.

I think challenge is to find a subscription which would fit our needs, trying to get that guidance.

Thanks for your responses.

Hi Janos
Thank you so much for your response Yes, I could see that details under Measures - Size - Lines of Code

Since the new lines is making us to reach threshold, would need to find the right subscription I guess.

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