SonarQube Version 7.2.1, SonarScanner for MSBuild 4.3.1, TFS 2015.2 VNext Build.
I am trying to exclude a few common folders (cs projects are in these folders) from analysis, code coverage, so I started with code coverage first. I go to Analysis Scope for the SonarQube project and want to exclude *ServiceHost,
so I try these under coverage exclusions.
**/ServiceHost/
*/ServiceHost/
Either of these do not exclude the folder from code coverage and the code coverage results shows project in this folder as not covered reducing the coverage. Can you please advise what I am doing wrong? I have attached the end analysis build log for your reference.
On a related note, is it possible to change the project setting and apply it on the latest run? That way, when experimenting with the wildcards, we don’t have to wait for a full build run.
To make it a little clearer, I’ll include the exclusion from your logs with al the wildcards escaped so that Discourse formatting doesn’t confuse things.
**/*ServiceHost/**
While theoretically this excludes all subdirectories, it does not actually exclude the files within those directories. Something like…
**/*ServiceHost/**/*
Should get you headed in the right direction.
On your related note – no, changes to exclusions (and most if not all other project configuration) currently always requires a new analysis.
Thanks for the info, tried **/*ServiceHost/**/*
but it does not change the code coverage. Argon.Services.ServiceHost files still show up in code coverage and skew the results. Anything else you see I am missing? Attached the
log file.