Improving Speed of Run Code Analysis in CI

One of our projects takes significantly longer to run the Run Code Analysis step in our Azure DevOps CI Build process. I am having trouble finding a guide to determining what is making the analysis run slow and how to resolve. Suggestions?

Hi Timothy, and sorry for the late reply.

You say the build takes “longer”. Can you give us more information / context?

  • What type of source code are you analyzing?
  • How long was the Run Code step before, how long is it now?
  • Did you change some settings - like adding some new rules?

We have the same issue, only we have just started to implement SonarQube in our organisation.

We have an Azure DevOps on prem build with the following tasks:

  1. Prepare Analysis Configuration
  2. 3 MSBuild tasks to build 3 solutions, 2 of which are rather big - ~90 projects each. These include running unit tests with DotCover or OpenCover, depending on the build parameter.
  3. Run Code Analysis

The problem is that Run Code Analysis takes ages. E.g.

Is there any way to troubleshoot it?


Do you notice either a high consumption of RAM, CPU, or disk access during the Run Code Analysis execution on the machine hosting the build agent ?