Error prompted during scanning that analysis has failed due to exceeding of maximum line limit

  • Sonarqube server version : v2025.4.2 (112048),Sonarqube scanner version SonarScanner CLI 7.1.0.4889
  • Sonarqube is hosted as a on-prem server
  • We are currently attempting to scan our code repository using SonarQube. The repository is configured as a local repository (not connected to GitHub or any SCM). However, we are unable to perform any scans since this error occurred.
  • Whenever we attempt to run a scan, the process fails and we receive the following error message:
    “The last analysis failed because it would have caused your server-wide lines of code total to exceed your 1000000 limit.Go to License page.“

We were performing scanning of our code repository using Sonarqube server.All our scanning has been done using local repository options in Sonarqube. While we are trying to run the scan we are prompted with error stated above. We would kindly need support for the same.We are not able to proceed with any scanning due to this issue.

We expect the scan to complete successfully without exceeding the server-wide LOC limit, or to receive guidance on how to resolve the license/LOC limitation.
Clarification needed:
1.How does SonarQube handle repeated scans on the same local repository?
Does it analyze only modified files or does it re-scan the entire codebase each time

2.How does SonarQube handle scans performed on the same code but created as different local repositories?
Does it analyze only modified files or does it re-scan the entire codebase each time

3.If multiple scanners are used for the same project, will SonarQube re-scan all lines of code?
Does running different scanners trigger a full scan again, thereby increasing the LOC count?

Hi,

Analysis covers every file each time. However, this is not eating up your license. If you have a 1,000-LOC project and you analyze it 100 times, that works out to… 1,000 license-LOC.

If you use the same sonar.projectKey value each time, then all repos will resolve to the same project in SonarQube.

This is an interesting question. I suppose you’re using multiple scanners because you have multiple languages in the project? Unless we’re talking about .NET and Java, you should be able to analyze all the languages in your project with just one scanner.

But back to the actual question: If you’re using the same sonar.projecKey value with each scanner, then you’re not puffing up the license-LOC, but you are overwriting each previous scanner’s results with the next one. If you are using different sonar.projectKey values, then yes, each scanner will add to your license-LOC and since most scanners pick up most languages, there will be duplication.

The thing you didn’t ask here, but I want to touch on anyway, is what’s being analyzed in this project. You can add -Dsonar.verbose=true to your analysis command line to turn on debug logging and see (among other things) which files are being indexed by analysis. You should probably look through the list and make sure you’re not picking up

  • 3rd-party libraries
  • generated files
  • &etc

that you didn’t mean to.

 
HTH,
Ann