SQ scan failing saying that we have reached out LOC limit for our license

The scan for one project is failing due to us reaching our LOC limit, but we are still 2+ million short of reaching our 5 million LOC license. I had the team re-run the scan with DEBUG turned on and did not see any evidence as to why this is happening for this project but not others.

  • Sonarqube server version: 8.6.0.39681
  • Project in question: under 70,000 LOC
  • LOC left on license: 2,991,730 out of 5,000,000
  • What are you trying to achieve: a scan
  • What have you tried so far to achieve this: I emailed support and they sent me to the community forum.

Hi,

Welcome to the community!

Unfortunately, I haven’t been able to get them to add a LOC count to the analysis logs, so diagnosing this isn’t as easy as it maybe ought to be.

I would start by comparing:

  • Comparing analysis logs from before and after this started being a problem. They may give you some idea of what’s being analyzed & whether that has changed
  • Checking the commit history on your sonar-project.properties file to see whether this has changed.

Most likely, the set of files under analysis has changed. The question is:

  • were a bunch of new files / libraries added that need to be excluded
  • were existing exclusions removed
  • was sonar.sources edited to include more files

 
Ann

Thanks Ann!
It should be noted that this is a new project and we haven’t completed a successful scan of it yet. That will make comparing before/after logs or excluding/including a bunch of files.

“That will make comparing … difficult.” :slight_smile:

Hi,

I guess so! :joy:

From the way you approached this, I had the impression that a project under analysis was suddenly blowing out the license LOC.

What you’re telling me now is that you’re adding a brand new project that’s blowing out the LOC.

So your best course is to go back to basics: take a fresh look at the value of sonar.sources and make sure it’s properly narrowed down to just your source code. No libraries &etc. In fact, I would start by making it a little too narrow on purpose. Get the project analyzed & gradually expand the scope.

 
HTH,
Ann

Sounds great. I will take this back to the team and have them give this a shot. Thanks!