We are doing a SonarQube-Code-Analysis in an Azure Pipeline. We are using SonarQube 8.5.1. The analysis works fine and I get a proper result. But the pipeline takes forever to finish.
Buildtime without SonarQube: 5-10 mins
Buildtime with SonarQube: 25-30 mins
The task that takes the longest is the actual build with msbuild (MSBuild@1). The analysis task (SonarQubeAnalyze@4) takes only 2 mins.
I have several exclusions defined in the SonarQubePrepare@4 step with sonar.exclusions. But these exclusions don’t seem to work during the build.
I as well added folloing project config in a Directory.Build.props file
<project> <ItemGroup> <SonarQubeSetting Include="sonar.coverage.exclusions"> <Value>Source/UiWebDefinitions/**/*,Source/UiWeb/**/*,**/*.xml,packages/**/*,Test/**/*,docs/**/*,**/obj/**/*,Source/**/*Form.*,Source/**/*.designer.*,Source/**/*.resx,**/*.dll,**/*.exe</Value> </SonarQubeSetting> </ItemGroup> </Project>
(Sorry about the formatting but I could
… but without any improvements.
My question is: How can I properly exclude files from the build-analysis?
Thanks for your help.
Just let me know if you need additional information.