# SonarCloud "main branch empty" and "no lines of code"

**URL:** <https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911>\
**Category:** SonarQube Cloud\
**Tags:** teamcity, csharp, scanner, sonarqube-cloud\
**Created:** [May 6, 2021, 9:30pm UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911 "2021-05-06T21:30:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvisser](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jvisser](https://community.sonarsource.com/u/jvisser)\
**Post date:** [May 6, 2021, 9:30pm UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911/1 "2021-05-06T21:30:29Z")

</div>

We have been using SonarCloud successfully for about a year on our private projects. Recently, the main page on our organization shows “The main branch of this project is empty” for the Project in question, and the browser for the branch itself shows “The main branch has no lines of code.” The code page on the project however, does show our code as expected. All the analysis themselves look fine, and all background tasks show successful completion.

I have cleared out all the PRs from the “Branches and Pull Requests” page, and noticed that there was a weird instance where one main branch appeared as though it was a PR into another main branch. I have also tried re-naming the main branch and running a new build to see if the newly listed branch was shown correctly, and it was not.

ALM: Bitbucket Cloud  
CI: TeamCity  
Scanner: sonar-scanner-msbuild-5.0.4.24009  
Language: C#

Our command line to start scanning looks like:

```
  C:\sonar-scanner-msbuild-5.0.4.24009-net46\SonarScanner.MSBuild.exe begin `
   /o:<org> `
   /d:sonar.host.url=https://sonarcloud.io `
   /d:sonar.login=<login> `
   /k:<Project> `
   /n:<Project> `
   /v:2.0.0.2499 `
   /d:sonar.branch.name=develop `
   /d:sonar.inclusions=Navigator*/**/*.cs `
   /d:sonar.exclusions= **/*.g.cs,** /*.Designer.cs,ConfigurationConverter/**/* `
   /d:sonar.cs.dotcover.reportsPaths=dotCover.html
```

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [May 7, 2021, 6:45am UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911/2 "2021-05-07T06:45:06Z")

</div>

Hi @jvisser, welcome to the community !

Are you analyze javascript / typescript code as well as part of this scan by chance ?

Thanks.

---

<div class="post-metadata">

**Author:** ![jvisser](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jvisser](https://community.sonarsource.com/u/jvisser)\
**Post date:** [May 7, 2021, 5:18pm UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911/3 "2021-05-07T17:18:57Z")

</div>

No I am not, this is purely C# code. The inclusions should analysis just C#.

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [May 10, 2021, 6:26am UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911/4 "2021-05-10T06:26:57Z")

</div>

Thanks @jvisser

Can you share a debug log of the “end” step please ? it will help us troubleshoot.

Thanks !

---

<div class="post-metadata">

**Author:** ![jvisser](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jvisser](https://community.sonarsource.com/u/jvisser)\
**Post date:** [May 27, 2021, 6:50pm UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911/5 "2021-05-27T18:50:42Z")

</div>

Thanks! Attached is a log. If this isn’t detailed enough, how do I increase the log level?

[sonarcloud.log](https://community.sonarsource.com/uploads/short-url/spmAmLzgpT82sc4XX2EkFwMUYha.log) (449.2 KB)

---

<div class="post-metadata">

**Author:** ![duncanp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/duncanp/32/293_2.png) [@duncanp](https://community.sonarsource.com/u/duncanp)\
**Post date:** [October 21, 2021, 1:43pm UTC](https://community.sonarsource.com/t/sonarcloud-main-branch-empty-and-no-lines-of-code/42911/7 "2021-10-21T13:43:39Z")

</div>

@jvisser apologies for the delay in responding. Is this still an issue?
