I am trying SonarCloud for my CI. My project is on Github (it’s not very beautiful, it’s a student project , I am here to learn so please don’t judge me
) GitHub - SimonGriang/SQSWebApp
I am having a Github Action for using Sonar. Therefore I used the instructions on SonarCloud for the build.yml and Sonar_Token generation.
My ASP.net Core MVC Web Application has the following structure:
SQSWebApp
|
|- WebApp (with solution and csproj file)
|- UnitTests (MSTest project with all my Unit Test, this project is added to the solution.)
Now I have the Problem that Sonar says my “The main branch of this project is empty.”
Last analysis has warnings
- Your project contains only TEST-code for language C# and no MAIN-code for any language, so only TEST-code related results are imported. Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. Read more about how the SonarScanner for .NET detects test projects: Analysis of product projects vs. test projects · SonarSource/sonar-scanner-msbuild Wiki · GitHub
I don’t get why Sonar does not recognize my main project. Even though it shows code smells for the WebApp folder.
You can check out my build.yml file here: SQSWebApp/.github/workflows/build.yml at main · SimonGriang/SQSWebApp · GitHub
Also my Test-Coverage is not visible even though I followed the steps of .NET test coverage & SonarCloud
I could not find anything helpful so far
I really would appreciate any help.