which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube Version - 8.6.0.39681 Developer edition
what are you trying to achieve
We have hosted sonarqube on Azure VM and we are trying to run code analysis and get Quality gate
results through pipelines in devops.
what have you tried so far to achieve this
We created new project in sonarQube and using Project Key and Authentication code we have
setup the sonarqube configuration in Devops pipeline by creating a new service connection to Sonar
endpoint server. We are successful to get Quality gate results of small solutions but we are not able
to achieve
the same for one of the solution while all the projects are build in .net framework.
All the sonarQube task (Running code analysis and Publish quality gate results) were successful in devops pipeline but in SonarQube portal project is empty shows below message The main branch has no lines of code.
When the standalone scanner is used to analyze C# code (rather than integrating with MSBuild. You can check this in your Prepare Analysis Configuration build step.
Your Visual Studio projects are being classified as “Test” projects containing test code due to some bad configuration in your project files or the detection on our side. Check out this documentation to understand more.
– You might see log messages like this when your code is built, to confirm it:
SonarQubeCategoriseProject:
Sonar: (SonarQubeHelloWorld.csproj) Categorizing project as test or product code…
Sonar: (SonarQubeHelloWorld.csproj) project has the ProjectCapability ‘TestContainer’ → test project
Sonar: (SonarQubeHelloWorld.csproj) Project categorized. SonarQubeTestProject=true
Verified the Pipeline Build logs for all the projects inside solution.
For all projects i can see SonarQubeTestProject=False
2021-01-11T05:25:41.7217506Z SonarQubeCategoriseProject:
2021-01-11T05:25:41.7217835Z Sonar: (SEyc.Frameworks.RequestProcess.ADOApi.csproj) Categorizing project as test or product code…
2021-01-11T05:25:41.7255459Z Sonar: (SEyc.Frameworks.RequestProcess.ADOApi.csproj) Project categorized. SonarQubeTestProject=False
Except the actual test projects -
2021-01-11T05:31:32.6128572Z SonarQubeCategoriseProject:
2021-01-11T05:31:32.6128884Z Sonar: (SEyc.Apps.Cluster.Tests.csproj) Categorizing project as test or product code…
2021-01-11T05:31:32.6135666Z Sonar: (SEyc.Apps.Cluster.Tests.csproj) project has the ProjectCapability ‘TestContainer’ -> test project
2021-01-11T05:31:32.6136397Z Sonar: (SEyc.Apps.Cluster.Tests.csproj) Project categorized. SonarQubeTestProject=true
We can share the build logs ,let me know if required