Lines of Code Failing Analysis

Since July 2, our project analysis has been failing with the error “This analysis will make your organization ‘[org name]’ to reach the maximum allowed lines limit.” Under administration, I can see that our project is at “170,338 private lines of code analyzed over 1 projects” on a plan that supports 250k. I can no longer push new branches to be analyzed, due to the failure, but the new code is actually smaller than the last successful scan. Has there been an update to SonarCloud that would prevent this scan? I’ve tried re-running the last know successful branch, and that too is failing now.

Our codebase is roughly 400k total lines, according to the “Sizes” on the “Measures” tab, but still showing only 170k actual lines of code. So could it be failing due to overall size now instead of just the actual lines of code?

The total lines of code is counted based on the lines found in files configured as sources in languages that SonarCloud can actually analyze. Some examples that could lead to a sudden jump in the detected total lines (non-exhaustive list):

  • The sonar.sources or sonar.exclusions parameter has changed, and now more code gets analyzed than before.
  • The scanner command has changed from the Maven scanner to CLI, which configures the sonar.sources less accurately, and now more code gets analyzed than before.

How exactly do you run the scanner? Has something changed in the configuration of the scanner execution recently?

We are using Azure DevOps to run the scanner and are using the default Sonar Way quality profile. No changes have been made in the configuration on our side since we first integrated back in October. You’ll see from the metric below that in mid-December a change was made to the Sonar Way profile which dropped our lines of code in half. And then again in early July another change to the quality profile doubled our lines of code. So by moving up our plan to a 500k lines of code limit, we are able to scan successfully again. I don’t see any release notes mentioning updates to VB.NET that would cause these drastic changes. Any thoughts Janos?

image