SonarSource / sonar-scanning-examples

Shows how to use the Scanners
GNU Lesser General Public License v3.0
894 stars 2.24k forks source link

Manually set as main project as Product Project/Code #128

Closed joe-tingsanchali-sonarsource closed 2 years ago

joe-tingsanchali-sonarsource commented 2 years ago

Without setting it manually or removing reference to 'Microsoft.VisualStudio.TestPlatform.TestFramework', then the sonar-scanner-msbuild will categorize this project as TEST code/project. See categorization logic. This is what you will see if you don't manually set as Product/Main Project:

SonarCategoriseProject:
  Sonar: (SomeConsoleApplication.csproj) Categorizing project as test or product code...
  Sonar: (SomeConsoleApplication.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.TestFramework' reference.
  Sonar: (SomeConsoleApplication.csproj) categorized as TEST project (test code).

After:

SonarCategoriseProject:
  Sonar: (SomeConsoleApplication.csproj) Categorizing project as test or product code...
  Sonar: (SomeConsoleApplication.csproj) SonarQubeTestProject has been set explicitly to false.
  Sonar: (SomeConsoleApplication.csproj) categorized as MAIN project (production code).