My analysis says it will exceed my 5 million LoC limit, but I'm not even close to that limit

Must-share information (formatted with Markdown):

  • which versions are you using
    • SonarQube Enterprise Edition 9.9.6 build 92038
    • SonarScanner for MSBuild 8.0.1
  • how is SonarQube deployed: Docker
  • what are you trying to achieve: Run a code analysis, have it report back to the server, and pass a quality gate.
  • what have you tried so far to achieve this: I’ve tried deleting projects, in case some hidden Lines of Code count was putting us over the limit.

After running an analysis scan, it fails because it says I’d have reached my limit (this is a project that has less than 1000 lines of code)

I have over 2 million lines of code remaining for my license:

Why isn’t it working? Is there something I can do? Please let me know if you need anything else from me.

Hi @cseges ,
In the first screenshot, I saw that the last analysis was dated 3 March 2023. This project therefore had 993 Locs, but you should check this now.

Today you may have a problem with your source path or new files in the source directory. Take a look at the analysis configuration.

Hi Bachri,

Thanks for taking the time to look at this! The screenshot is just showing the branch that has the most lines of code in it. There are only 6 branches in this project and the master branch is the biggest:

This is the branch I’m currently trying to run a scan on, but it fails with the error mentioned above.

Again, thank you for looking into this, as I’m really at a loss!

Hey there,

I see that you are using the latest version of the scanner, namely v8.0.1.

In that version, we introduced multi-language support, which by default analyzes a lot more files.

We are working on a solution on the next patch version, but until then, you can specify /d:sonar.scanner.scanAll=false on the begin step to make your analysis not exceed the LOCs once again.

Please let me know if this fixes your issue.

2 Likes

Hi @cseges,

We just released v8.0.2 of the Scanner for .NET that implements some corrections for coverage files and allows using sonar.exclusions to fine-tune the analyzed files if needed.

Please let us know if this works for your use-case.

Denis.

1 Like

Thanks, Gregory! That was it. I’m not sure what it was pulling in to scan in order to exceed 2 million lines of code, but adding that flag fixed the issue.

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