During testing of a build using SonarQube v8.9.0.43852 we’ve noticed some .cs files aren’t being scanned now, whereas they were on SonarQube v7.9.5 (build 38598).
This shows the lines of codes being recognised in v7.9 (within the subfolders are the .cs files):
Check the logs of the MSBuild stage to see if how your MSBuild projects are being classified during analysis has changed (search for the string Categorizing project as test or product code...).
FYI the way the SonarC# analyzer classifies and handles test or product code changed in v8.21 of the plugin. Now, issues but not metrics will be reported on test code.
If your projects are now being classified as test code then the log output should explain why.
Hi @duncanp - Thanks for the reply. I can’t seem to see that string you mentioned in the logs. Are you able to provide a location for me please to upload the logs securely to you to have a look?
The projects are being correctly categorised, so it’s not that. I can’t see anything else obviously wrong, unfortunately. Could you try the following please?
turn verbose logging on for the dotnet build step and send me those logs (-v:diag)
run the analysis from the command line using the latest version of the Scanner for .NET. Your build is using v5.0.4, and the latest is v5.2.1. I wouldn’t expect it to make a difference, but it would be useful to rule it out.