Exceeding LOC count with a new project, despite LOC well within limit


I’m getting the “##[error][SQ] Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 1000000 limit.” error during the Publish Quality Gate Result on a build.

I have a license for 1 million LOC, currently ar 700k, the new project is 200 loc, what’s up with that?

Details below, thank you in advance for any advice.

SonarQube ID information
Server ID: 29DC1D7A-AWxDcOGx9rt_ZDjBrJjn
Date: 2020-11-27

Hello @mkingscott,

Can you provide:

  • A screenshot of your license page with your current LoC usage (you can hide all the rest)
  • Some details of your build environment (SCM ? CI ? etc…)
  • The logs of your scanner execution preferably ran in DEBUG mode (add sonar.verbose=true option)
  • Some evidence that the new project is on 200 LoC (or is this 200K LoC ?)


1 Like

I had exactly the same problem a couple of weeks ago, and it turned out to be the 4.17 of the Azure DevOps SonarQube Scanner Task (which had automatically been updated) was managing to analyse .NET Core projects that had in the past been skipped as they had no ProjectID.

Hence I needed bigger LoC license

Hello Richard,

I’ve attached the requested files, and as for build environment, we’re using MS Build with a “gatekeeper” build and CI.

Thank you for having a look.

Kind regards,

Mike Kingscott

locissue.zip (106.2 KB)

Hello Mike,

When running the scanner, it finds 10 C# files (which I guess what is counted by the “Code Metrics” tool screenshot with 1167 LoC.
But the scanner also finds 6 CSS files and 147 JavaScript files.

  • If those files are intended to be scanned, then definitely your LoCs in that project is much more than 1167. 6+147=153 files seems a bit too little to produce 300K LoCs but it remains realistic if those files are relatively big.
  • If those files should not be scanned, then you must exclude them explicitly. Pass /d:sonar.exclusions=**/*.js,**/*.css to your scanner begin step for that.

Let me know.

1 Like

Hi there,

Excluding the files worked like a charm, it was some huge MS js files that were the culprit. I’ve added in the necessary exclusion entries to the project.

Thank you for your help :grinning:

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