Unable to publish analysis to sonarcloud because of large LoC

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Languages of the repository: C#, JavaScript
  • Error observed: the sonarcloud.io console show a link to error indicating that the LOC (in excess of half a million LOC) is too large.

We have paid the “starter” subscription for an account (10 USD a month?) but we haven’t been able to obtain a single published analysis, although sonarscanner has run successfully (we have ruled out other forms of errors due to misconfiguration)

What is it that we need to do to publish an analysis regardless of the LOC?


The “10 USD a month” is limited to 100K LOC so you will never manage to see the results of your big projects unless you increase your subscription to something that allows more LOCs:

Before doing that, I suggest that you try to scan a smaller project to become more familiar with the product and then only increase your subscription to a bigger package to scan your 500K LOC project.


Many thanks for clarifying the relationship between pricing and LOC. I remember seeing this when we first signed up, but was unable to look it up later as account access is retained by someone else.

One feature request that comes to mind: sonarcloud can accept and display analyses for larger projects, together with a notification to customers giving them the opportunity to “upgrade”, perhaps for a limited time.

I will now look for pointers to independently establish whether the LOC count is accurate, because the analysis is being run on a small application. Any suggestions are appreciated.

Thank you!


I’m biased but I can tell you that the way we compute LOC is accurate. Our solution is used by millions of developers, and thousands of organizations so if it was not accurate, we would know it. :wink:

My first suggestion is to narrow the focus to be sure you don’t have a directory full of generated code, config, or test results that are considered by one of our analyzers. It can happen with XML files for example.

For that, here is the documentation to configure more precisely what you want to scan. I suggest that you start by configuring the scan to only focus on a special directory that you know and then extend until you find the one that contains too many LOCs.
Another solution is to use the SonarQube Community Edition. With it you have no LOC limitation but fewer features, and fewer analyzers. Still, that should allow you to scan your project by going into the Measures page to see the breakdown of LOCs.

Do you confirm you used the SonarScanner for .NET?