# Getting the error "The main branch of this project is empty." when running sonarqube analysis through Azure Devops CI pipeline

**URL:** <https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363>\
**Category:** SonarQube Server / Community Build\
**Tags:** azure, sonarqube, dotnet\
**Created:** [March 4, 2022, 2:51pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363 "2022-03-04T14:51:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rehan](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rehan/32/3410_2.png) [@Rehan](https://community.sonarsource.com/u/Rehan)\
**Post date:** [March 4, 2022, 2:51pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/1 "2022-03-04T14:51:54Z")

</div>

Hi All ,  
I am using Sonarqube Community ver : 8.9.6  
and I am trying to Run code analysis via Azure Devops CI pipeline.  
I am getting the error “The main branch of this project is empty.”

I have set up this analysis for several pipelines, all is working fine except one where I get this error.  
All other pipelines are also using same Sonarqube and Azure.

Can you please give me some idea what could cause this issue and how to resolve it ?

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/0/20bc77d845d65d8a0568417408333759eb7fa041.png)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 4, 2022, 5:43pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/2 "2022-03-04T17:43:55Z")

</div>

Hi,

We show this message when there’s no `ncloc` measured on the main branch. If you

- click through to the project homepage
- go to the measures tab
- expand the Size list

… what do you see?

[E.G.](https://next.sonarqube.com/sonarqube/component_measures?id=org.sonarsource.java%3Ajava)  
 ![Selection_033](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/1/b/1b7597b7f025b5d2ea076a5deb730d1a4c6fb774.png)

Also, what languages are in your project?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Rehan](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rehan/32/3410_2.png) [@Rehan](https://community.sonarsource.com/u/Rehan)\
**Post date:** [March 7, 2022, 1:08pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/3 "2022-03-07T13:08:53Z")

</div>

The language of the project is C# . The size shows nothing.

![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/4/c4e76014338bbacc7ee9beb6ab7abf4fe664784e.png)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 7, 2022, 1:16pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/4 "2022-03-07T13:16:31Z")

</div>

Hi,

What about the other size measures?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Rehan](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rehan/32/3410_2.png) [@Rehan](https://community.sonarsource.com/u/Rehan)\
**Post date:** [May 10, 2022, 12:22pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/5 "2022-05-10T12:22:07Z")

</div>

Hi Ann,

I am attaching below other measures and project setting.

One more thing I noticed from Activity is the analysis was showing some results till August 17,2021 and it shows nothing on Dec 10,2021 analysis. There’s no change committed between Aug 17 and Dec 10, 2021. What could possibly cause this ?

 ![22](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/3/c/3c8bba7549f4b207dd184c3450523cf8960a17c4.png)  
 ![23](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/e/d/eda256cad9693d48a33276dcc0df19535d8b6a07.png)  
 ![24](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/8/1/81b6c7f4dcb70f4fcf08aea2bea62a66a87368be.png)  
 ![25](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/1/6/166369d0e6e08422934d78be2088934195c77469.png)

Thanks !

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 10, 2022, 3:15pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/6 "2022-05-10T15:15:24Z")

</div>

Hi,

You’ve already shown me that there are 0 New Lines. I was asking about the other measures in the Size domain, not the values in the other domains.

I sent you a screenshot showing

- New Lines
- Lines of Code
- Lines
- Statements  
&etc.

Can you show me those values for your project?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Rehan](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rehan/32/3410_2.png) [@Rehan](https://community.sonarsource.com/u/Rehan)\
**Post date:** [May 10, 2022, 8:03pm UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/7 "2022-05-10T20:03:43Z")

</div>

Hi ,  
here’s all the details in size domain :

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/d/2d31f24f289910b97a10ec5c8c9b56311e61bfb3.png)

Regards,  
Rehan

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 11, 2022, 7:09am UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/8 "2022-05-11T07:09:28Z")

</div>

Hi Rehan,

What language are we talking about? And are you using a 3rd-party plugin to analyze it? It looks like the expected size metrics simply aren’t being provided for your project. And the UI relies on seeing a non-zero `ncloc` (non-comment lines of code) value to know that there’s something to display for the project.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Rehan](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rehan/32/3410_2.png) [@Rehan](https://community.sonarsource.com/u/Rehan)\
**Post date:** [May 11, 2022, 8:20am UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/9 "2022-05-11T08:20:58Z")

</div>

Hi Ann,

I can see the below warnings, why is considering my project as test-code, can i explicitly set it as Main code?  
The language is C# , quality profile sonar-way(C#)  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/f/2/f225d518980a53ccd4e1e6e0d645ee06c5877697.png)

![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/b/cb0e35bd7ac627bd3247e4ea4e07e2df597e2d1e.png)

Regards,  
Rehan

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 11, 2022, 9:30am UTC](https://community.sonarsource.com/t/getting-the-error-the-main-branch-of-this-project-is-empty-when-running-sonarqube-analysis-through-azure-devops-ci-pipeline/59363/10 "2022-05-11T09:30:14Z")

</div>

Hi Rehan,

That second warning is the problem. This may help:

> **[Analysis of product projects vs. test projects ·...](https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects)**
>
> SonarScanner for .NET. Contribute to SonarSource/sonar-scanner-msbuild development by creating an account on GitHub.

&nbsp;  
Ann
