Problem with calculating LOC

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command: Sonarcloud Run Code Analysis Task in pipeline
  • Languages of the repository: c#

We have a c# solution with 4 projects. One of them with autogenerated code from a database schema. This project is exclude of analisys with <SonarQubeExclude>true</SonarQubeExclude>. the scanner detect the exclusion and not analize, but in the Publish Quality Gate Result, we have a error for:

"This analysis will make your organization ‘xxxx’ to reach the maximum allowed lines limit’

Those lines are in the project exclude and we do not want them to be analyzed in any case.
How can we prevent this project from being processed?

Hi,

Welcome to the community!

You’ve said that your exclusion is working and the lines aren’t analyzed. I suppose you know that from examining your analysis log.

If they’re not showing up in the analysis log, they’re not being analyzed, and they’re not the cause of this error.

Unfortunately, it’s very difficult to diagnose where any “extra” lines are coming from when an analysis would push you over the limit.

I can only suggest you approach this in a binary-search manner: exclude half of your projects and see how many LOC the other half comes out to and whether that’s what you expected from those projects. And so on.

 
Ann

Hey @NachoEspiral

Just to add on, after some internal discussion, we’ve created an internal ticket to provide more details if the analysis reaches the limit of the maximum allowed lines. Thanks for the push.

1 Like