Can the part of the scanner that designates code as test code, be disabled?

The scanner designates some files as Test files. These are scanned and analyzed, and Issues show up separately in the generated web application. For our code base, the logic is placing most of our business and web applications, with the test code. We have been preparing to use the sonar.exclusions (which is working fine) property to scan what we want to scan, so, is there a way to just disable the Test code/Main code segregation, entirely, rather than having to slowly figure out how to fix this?

Please note that I have already tried several properties over the course of a few days, including every .NET (these are .NET 7 applications) and inclusions/exclusions property I could find. We’re using a SonarQube.Analysis.xml file.

I got help with this form Sonar support. The following node:

<SonarQubeTestProject>false</SonarQubeTestProject> 

in the PropertyGroup node of any .csproj, will make sure that the scanner doe snot designate this project as Test code, and it does not seem to interfere with the other scanner settings (we are using a Sonarqube.Analysis.xml) or the build.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.