This analysis will make your organization 'OrganisationName' to reach the maximum allowed lines limit

Hello guys, I know this question is common for this community, but nothing helps me to find the issue.
I have a integration between bitbucket-azuredevops-sonarcloud. So, the idea is to fetch the project from bitbuket and using Azure DevOps to analyse it for Sonarcloud.
Bellow is the pipeline created:


I want to say that I had initially the plan for 100k lines of code. Because of this message I thought that I need extend the plan to 250k lines of code. I did this and everything works great. I run it for a specific branch, lets say X.
Next day, after I made a new run, but for another brach, let say Y, I got the same message but with an amount of lines of code bigger than the old one. Nothing was changed in the meantime, but still I got the message that my organization ‘OrganisationName’ reached the maximum allowed lines limit. I don’t understand what actually happening here.

Hello Alin,

And welcome to the community!

For your private project normally only the branch that has the most lines of codes counts toward the limit.
So that would mean that the new branch that you analyzed is way bigger than the previous one.

In your organization administration under billing you can check the details of what projects contribute how many private lines, you should start by checking if the numbers you see there make sense or not.

Then if one of your project is way bigger than expected you should check if you are analyzing external libraries or dependencies that would contribute to the unexpected size of your project. You can check the documentation about narrowing the focus of your analysis.

Hello. Thank you for your answer.
The branch is not bigger than the first one, because it is a copy of the first one.
This is my plan:
image

Ok thanks,
Then could you share the id of the analysis that fails with this message? You should be able to find it in the background task page of your project. (You might also find some interesting logs about the analysis itself in this page)

Based on this message it seems that the ID is AXN6S6EsZf05kMgVVce8.

I just run the pipeline for my master branch and it failed with the following error message: [SQ] Task failed with status FAILED, Error message: This analysis will make your organization ‘XYZ’ to reach the maximum allowed lines limit (having 568608 lines). Please contact the administrator of the organization to resolve this issue.

Before that, I run other pipeline for another branch and it works as expected. As I understand from this behaviour it looks like I can create only one pipeline because the 2nd pipeline exceeds the total line alocated for my plan.

Thanks,

So it’s finding 568k lines of code in this new branch. If I understand correctly this branch has a different pipeline configuration ? Could you share the config ?

Could you share the scanner logs of this failing task to try to find out where all those lines are coming from ?

Thank you for your answer.
Indeed it has a different pipeline. I also tried to configure it in the pipeline of the repository that is currently working, but without success.
The configuration is the same as for the one that it is working.
Not sure what configuration should I share.

This one?

As can be seen in the screenshot bellow everything works great except the part when the SonarCloud part is starting because of that error.

And below it is attached the error that is thrown. It is just this error. No other errors encountered.

How the code analysis is actually working?
For example, if I have 3 pipelines that contains repositories with different lines of code, let say:
rep 1. has 100k lines
rep 2. has 100k lines
rep 3. has 60k lines
The total lines of code is 260k.
So, if my plan is for 250k lines of code, the 3rd pipeline will fail?
Does the restriction for the lines of code from my plan apply to ** repository** or ** repositories**?

What is strange is that the failed repository contains approximately the same amount of code as the repository that is currently working. I said approximaticaly, because the one that works was updated with some extra code in the meantime.

I was more thinking about the task configurations in the pipe and the config in your project.properties file if you have one.

Yes the analysis can run without issue, it’s only once the report is sent to SonarCloud that the licences is checked.

Exactly, in this case the analysis of the 3rd project will fail. The plan applies to all your private repositories.
In fact any new analysis that would make go over your maximum lines of code would fail, so if you had only two project at 100k lines and then create a PR on one of them that would add more than 50k new lines, this analysis would fail with the same message that you get.

Usually when we see big jumps of lines of codes like this it’s because in the config of the new project some unwanted code gets analyzed instead of being ignored. It could code form libs that you depend on, or generated code,… folders containing that kind of code should be ignored in your project.properties file, so that only your sources are analyzed.

Ok. Thank you.
I understand the way of project working. But for me it is only one project and I am trying to configure different braches. So, it is master project that have 3 branches. These branches are clones from the master project(actually the same content). Are they treat as separate projects?

Still I don’t understand where is the problem and always the master branch fails giving this error:
[SQ] Task failed with status FAILED, Error message: This analysis will make your organization ‘psaformsp-bitbucket’ to reach the maximum allowed lines limit (having 565720 lines). Please contact the administrator of the organization to resolve this issue.
As can be seen in the screenshot attached release/v2.35.16 is just a clone of the master branch and when I run the pipeline for it everything is working, but master fails.