Trying to analyze the dot net core project with unit test cases on SonarQube server version 9.9.7, there are main source code folder e.g. ABC and unit test folder ABC.test. the main source code folder having all code which is not analyzing and not reflecting any metrics on SonarQube.
There is no exclusion property present while analysis. Please suggest.
Hi there, @Asawari
Would you mind sharing the (redacted) details of your pipeline and the (redacted) logs of the analysis?
Giving us the pipeline details and logs will help us figure out what is going wrong. Without that, we would just be shooting in the dark.
One problem people often encounter is that analyzing .NET code requires using the Sonar Scanner for .NET, not the scanner CLI. Is that what you are using?
Denis
Hi @denis.troller ,
Log_sharing_folder.zip (74.5 KB)
Please find attachment. Sharing the logs.
Hi @denis.troller ,
Please find attached file which contain pipeline definition.
Thank You!
Sonar.txt (7.1 KB)
Hi Asawari,
First, we’ll need to clean-up your pipeline and reassess.
Could you please remove the sonarqube tasks that are not suffixed by @7?
You should not have more than one task of each type (Prepare, Analyze, Publish) in succession.
Also make sure your SonarQubePrepare task has the following input:
scannerMode: ‘dotnet’
This will ensure you are using the right scanner for your analysis.
So to summarize:
- Make sure you use the @7 version of each task
- Make sure each task (SonarQubePrepare, SonarQubeAnalyze, SonarQubePublish) is present at most once in this pipeline
- Make sure you include “scannerMode: ‘dotnet’” in your SonarQubePrepare task inputs.
Let me know if that works better or if you still encounter problems.
Denis