- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Scanner command used when applicable (private details masked)
- task: SonarCloudPrepare@1
displayName: 'SonarCloud - Prepare analysis'
inputs:
SonarCloud: ${{parameters.sonarCloudServiceConnection}}
organization: ${{parameters.sonarOrganization}}
scannerMode: 'MSBuild'
projectKey: ${{parameters.sonarProjectKey}}
projectName: ${{parameters.sonarProjectName}}
extraProperties: |
sonar.cs.vstest.reportsPaths=**/*.trx
sonar.cs.opencover.reportsPaths=**/*.opencover.xml
sonar.coverage.exclusions=**/*Controller.cs
sonar.exclusions=**/Migrations/**/*.cs,**/PackageRoot/**/*,**/Swagger/**/*,**/appsettings*.json,**/*.Service.xml,**/Data/**/SeedData/**/*,**/Data/**/Seed*.cs
- Languages of the repository: C# primarily
- Error observed:
On a couple of our projects, we’ve experienced a massive drop in LoC analyzed. It looks like it’s excluded*.cs
and only some leftover XML and CSS files are analyzed.
When navigating the project in the portal I do see the .cs
files, but they are listed with - LoC
I’ve tried disabling the sonar.exclusions
and sonar.coverage.exclusions
properties and re-run the scan, but it had the same result.
It started with 1 project, but it looks like it’s “spreading”, as 8 of them now show this behavior.
Any ideas on what could be wrong?
Update 1:
I just tried deleting and recreating the project, but that ended up with the same result.
Update 2:
I’ve been looking at the ProjectInfo.log
files and I noticed that it marks all of the .csproj
files as "Test projects, while actually only 1 is a test project:
How does SonarCloud determine what is/isn’t a test project?