SonarQube Build Duration increased from 10 minutes to 5 hours

Hi @Danielson,

Does the build eventually complete successfully, and are the analysis results eventually uploaded to SonarQube successfully?

As a rule of thumb, we’ve expect the build time to approximately double with analysis enabled, so even going from ten minutes to an hour would be very unusual. However, there are corner cases where a particular analysis rule performs very slowly on a specific file (e.g. this bug).

My guess is that is what is happening here - most projects will be analysed ok, but there will be one or two files that aren’t being handled correctly that are causing the vast bulk of the increase. If that’s the case, then the workaround is to exclude those files from the analysis.

To confirm whether this is the case, I suggest you try passing the following properties to MSBuild:
/p:reportanalyzer=true /v:d
… and then search the logs for Total analyzer execution time: to see if analysis is particularly slow for one or more projects (see the post Help Figuring Out .NET Project Scan Taking Significantly Longer for more info).

It looks from your build log that your solution is only building the *.wixproj, which in turn is using PowerShell to trigger a separate MSBuild. I think the problem is occurring in that “inner” build so that is one you’ll need to pass the additional parameters to.

1 Like