.NET Scanner Caused LOC Limit to be Exceeded

Hi all,

We’re using SonarCloud and Azure DevOps, with a monorepo that contains a very large SQL Server project (not scanned), as well as a TypeScript project and many .NET projects. Up until recently, we were comfortably within our LOC limit.

However, it seems the latest version of the .NET Scanner now opts-in to scanning other languages, which in our monorepo has caused carnage, as we now have several projects all including the same 600K LOC from our SQL Server directory. This has pushed us way over the paid-for LOC, all for code we never wanted to be scanned.

From another thread, I know I can set sonar.scanner.scanAll=false in the pipeline’s options field, but because we’re over the LOC, no new analysis will go in, so we can’t fix the issue (which I’d argue isn’t our fault - who makes an option like this opt-out, when the extension can update the scanner with no one knowing).

Is there anything we can do short of deleting the projects, losing the history?

Thanks!

Hi,

In fact, if you try to submit an analysis that would put you over the LOC limit, it’s rejected. So you’re not actually over the limit, and you should be able to enable this option and run new analyses.

Please come back to us if that doesn’t work.

 
Ann

Hi Ann,

I think the issue is that we’re so far over the limit (i.e. the limit is 1M, we’re at 7.7M), that even if one of the projects were to be submitted with fewer LOC, it doesn’t get us below that 1M.

I can see in the log from DevOps that before adding the sonar.scanner.scanAll option in the config it detected 7 languages in 11752 files, and after the setting only 2 languages in 5887 files. The option is clearly working, with the report generated at the end being several times smaller too.

However, we’re still getting the following message in the SonarCloud task log, the link to which I found at the end of the DevOps log…
This analysis will make your organization '***' to reach the maximum allowed lines limit (having 7026062 lines). \nPlease contact the administrator of the organization to resolve this issue.

Thanks,
Sean.

Hi Sean,

Are you seeing 7.7M in the SonarCloud UI? If so, can you share a screenshot, redacted as necessary?

 
Thx,
Ann

Hi,

Unfortunately yes…

Thanks,
Sean.

Hi Sean.

That’s… not supposed to happen. :thinking:

And because this isn’t supposed to happen, there’s not a normal way out of this. I’ve talked to your sales rep about this and you should be hearing from him shortly.

 
Ann

Hi Ann,

Thanks for your help!

I guess you mean that we shouldn’t have been able to submit any of the 7 other dodgy analyses after the first one pushed us over the LOC limit? Or should that first one not have gone in either?

Thanks again,
Sean.

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