0

I can't figure out what is wrong with this task in DevOps to exclude all files in the path: **.AdminCenter/companyname.AdminCenter.FrontEnd/xyz/lib

- task: SonarCloudPrepare@1
  inputs:
    SonarCloud: 'SonarCloudTokenDigitalisering'
    organization: 'digitalisering'
    scannerMode: 'MSBuild'
    projectKey: '***************.AdminCenter'
    projectName: 'AdminCenter'
    extraProperties: |
      sonar.exclusions=**/lib/**/*,**/*.dll
      sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml
  sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx

sonar.exclusions=**/lib/**/* should do the trick, but all files are still visible in the Code-tab enter image description here

Peter
  • 489
  • 3
  • 16

1 Answers1

1

You can try specifying the full path to the lib folder in the sonar.exclusions property.

sonar.exclusions=AdminCenter/companyname.AdminCenter.FrontEnd/xyz/lib/**/*,**/*.dll

If there is Test in the name of the folders, it will be considered test files. You will need to add sonar.test.exclusions property. sonar.test.exclusions=**/lib/**/*,**/*.dll.

You can also try setting the File Exclusions in your SonarQube UI. See this blog post.

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43