Azure Pipelines code scan duration

  • Version: * Enterprise Edition * Version 8.3.1 (build 34397)
  • We have a repo with 87k LOC mainly C#. In Azure pipelines when I do restore packages and build the solution it takes ~7-9 minutes for whole process. When I include SonarQube Scan it jumps to 35+ minutes. Is this expected behavior? we want to lower the amount of time of the scan as much as possible.
  • We have beefed up the server and turned off debug logging in SQ but did not produce any notable results.

I went to the scan times and it actually only takes 2 minutes, but I am guessing the data collections of SQ start while the project is building that adds the extra time.

Edit: added more information

Hi Andres,

You may be analyzing more files than you truly want results for. You can check by running the scan (on the Azure side) in DEBUG mode and checking the logs to see all the files that are indexed. Then narrowing the focus of analysis down to only the files you want will likely cut down on this analysis time.

okay I am running again on DEBUG, thank you

I was able to shave off about 4 minutes, but still not fast enough. I am trying to understand why when I just build the Application in Azure Pipelines it takes 7 minutes in total, but when I add SonarQube the build processes takes 3x longer.

Hey there.

There are some pretty impressive performance improvements in C# analysis between SonarQube 8.3.1 and SonarQube v8.6. I would run your tests on the latest version (as v8.x versions are so far non-LTS versions, you should try and upgrade as soon as possible. They are EOL as soon as a new version is released).

okay thank you, we are looking to upgrade soon.

hello @Andres_D - did the upgrade solve the perf issue?