Template for a good new topic, formatted with Markdown:
ALM used (Azure DevOps)
CI system used (Azure DevOps)
Scanner command used when applicable (private details masked)
Languages of the repository C#
Only if the SonarCloud project is public, the URL
And if you need help with pull request decoration, then the URL to the PR too
Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
##[error][SQ] Task failed with status FAILED, Error message: This analysis will make your organization to reach the maximum allowed lines limit (having 1047834 lines).
This is only happening with the main branch of the project. The develop branch run with no issues.
Steps to reproduce
CI Build triggered after pull request
Can you double check the main branch configurations versus the develop branch configuration? I suspect the main branch analysis isn’t excluding some libraries or generated code that the develop branch is configured to omit.
Hi, I can confirm this is still happening. The CI build for the main branch keeps failing with that error message.
I have looked and the CI Build configuration, and the GIT Repos and I can’t find any difference that would justify the difference.
I have attached a breakdown of the lines of code for the solution.
I have also deleted the project from SonarCloud, added it again, tried to scan and got the same error.
2022-10-12T09:27:45.2014322Z ##[section]Starting: Publish Quality Gate Result
2022-10-12T09:27:45.2197215Z Task : Publish Quality Gate Result
2022-10-12T09:27:45.2197561Z Description : Publish SonarCloud’s Quality Gate result on the Azure Pipelines build result. To be used after the actual analysis.
2022-10-12T09:27:45.2201755Z Version : 1.11.2
2022-10-12T09:27:45.2201966Z Author : sonarsource
2022-10-12T09:27:45.2205302Z Help : Version: 1.11.2. More Information
2022-10-12T09:28:03.3285376Z ##[error][SQ] Task failed with status FAILED, Error message: This analysis will make your organization to reach the maximum allowed lines limit (having 1047834 lines).
Please contact the administrator of the organization to resolve this issue.
2022-10-12T09:28:03.3374114Z ##[section]Finishing: Publish Quality Gate Result
This message means that the analysis you are trying to execute has more LOC than the paid plan your organization is subscribed. This could mean the configuration for this analysis have some issue, like bad ignore expression for tests or other kind of files. But you mentioned that there is no difference between branches configuration so i will take a look into your organization this afternoon to check if there is something else.
We need to know first which files are causing the limit to be reached. Could you please use the tool CLOC on your project, using the same commit hash that failed the analysis? It will produce a nice output like this:
Thanks a lot! assuming this is the LOCs for the failing main branch commit, could you please to the same for the commit on the main branch that worked before (i saw that your main branch has one successful analysis at SonarCloud)? Additionally, could you also use CLOC with develop branch, using a commit that was successful, please? We should have such LOCs in our logs in the future, but now i can only rely on your output, sorry for that.
After you provide these LOCs, i will check the differences and also evaluate exclusions. For a .NET project, i see that you have a lot of CSS and JS LOC (only these two languages go over your LOC limit, or CSS + C# for instance). The exclusions “exclude” files from the analysis, you can read more here and in the topic i shared before (you have multiple places to setup exclusions as explained there). Your logs tell me there are any exclusions at the failing main branch analysis:
2022-10-12T09:25:14.3514997Z INFO: 0 files ignored because of inclusion/exclusion patterns
So, my conclusion is that these CSS and JS files are analysed, causing the limit issue. Let’s see the output you will provide about the other commits (main with success, develop with success) to have a better understanding.
Yes. If you want these type of files to be analysed, you need to upgrade your plan to a bigger amount of LOC. Otherwise, you need to exclude them from the analysis, because our analysers will process all incoming files.
There is a huge difference for the JS files. The successful Dev branch has 17663 LOC and the master failing has 520773. I am not sure about your project structure, but would guess NodeJS dependencies (node_modules folder) being pushed into your repository.
Yes, I noticed that too. Will need to confirm with the developers the reason for it. For now I am ok to exclude those files. I have read the documentation but not sure if I need to exclude the file type or folder type.
Adding this made no difference: