Master branch is not being recognised as default - Lines of code exceeds the plan

  • ALM used Azure DevOps
  • CI system used Azure DevOps
  • Languages of the repository: php, html, css, yml, xml

Two Errors observed:

  1. “master” branch has not been analysed yet and you have multiple branches already. It looks like it is not your Main Branch, check your configuration.
    Note: Default branch is master.

  2. “Your analysis with ID “xxxx” has failed: your number of lines exceeds your organization plan.”
    Note: However, from the billing tab can be verified that we have 270,832 private lines of code analysed < 1M where is the Team Plan.

Hi @Ele

To clarify, do you have a “master” branch in your project? Additionally, did you analyze a branch using sonar.branch.name=master ? This may be impacting the analysis results.
Some information about branch analysis are in the documentation Branch analysis setup & SonarCloud

Regarding the analysis failure, it seems that the number of lines of code may be exceeding the limit of 1M for our organization plan. It might be worthwhile to exclude some vendor libraries from the analysis to reduce the total line count.

Please let me know how we can proceed to resolve these issues.

Hi @Bachri_Abdel, thank you very much for your prompt response.

Yes, there is a master branch in the project. However, I am using azure-pipeline.yml to trigger the sonarCloud analyse with the below inputs to the SonarCloudPrepare@1 task:
SonarCloud: ‘’
organization: ‘’
scannerMode: ‘CLI’
configMode: ‘manual’
cliProjectKey: ‘’
cliProjectName: ‘’
cliProjectVersion: ‘1.0’
cliSources: ‘.’

Hence, do I have to define any extraProperties section like here ,
e.g. sonar.branch.name=master ?

When it comes to the organization plan and the upper limit of 1M LoC, the error message does not match with the “Billing & Upgrade” tab which says that the private lines of code analysed are less than 1M. Which of the two is the correct?

Thank you very much for your time. Looking forward to your response.

El.

Hi @Ele,
Yes, you can try to override autodetected sonar.branch.name in extra properties.

Thank you very much @Bachri_Abdel, I will do so.
Could you please let me know about the second matter as well?

“When it comes to the organization plan and the upper limit of 1M LoC, the error message does not match with the “Billing & Upgrade” tab which says that the private lines of code analysed are less than 1M. Which of the two is the correct?”

Hi @Ele,

Maybe the failed analysis which will bring the LOC upper 1M LoC is not take into “Billing & Uprade”.