Build time increased x20 times after implementing sonar cloud into pipelines

Hello Team,

We recently started using Sonar cloud in our build pipelines. Usually our Dotnet core project takes 10 minutes in total to build the code; after adding sonar cloud into pipeline it is taking 2 hours in total to scan the code. I need some help to debug the issue.

Here are some details, it might help you before we connect,

  1. We are using self-hosted build agents to build the code with 8 vcpus, 32 GiB memory.
  2. Our code size is 100K in total.
  3. Continuous Integration tool used - Azure DevOps.
  4. Code Language used in repo - Dotnet core

Please let me know if you need more details.


Any update on this ?

Hello @harshith.vangaveti , welcome to this forum.

As per our guidelines, please wait a few days before bumping the thread. Thank you for reading the guidelines.

  • to see what rules are taking time during build (see relevant topics on the community forum), please give us the verbose MSBuild logs: msbuild /p:reportanalyzer=true /v:d > build.log

  • please give us the verbose output of the command (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of thje BEGIN and END steps)

1 Like

Hello Andrei, thanks for you prompt response - Please find the verbose output attached Verbose.txt (1.1 MB)

buildlog.txt (3.9 MB)

Please find the MSBuild logs attached and let me know if you need any details.

Hey Team, Its been a while i posted the logs i requested - Do i have any update on this ? Please let me know

Hi @harshith.vangaveti , I apologize for the delay, I was on vacation.

From the build log, we can see that there is not much time spent during the Roslyn analysis. Our SonarAnalyzer.Security analyzers take 84, 5 and 2 seconds for your three projects. And our SonarAnalyzer.CSharp analyzers take 5 and 6 seconds.

The main problem can be seen in the Verbose logs of the END step:

The below sensor takes 30 seconds.

Sensor CSharpSecuritySensor [security] (done) | time=30359ms

Are you sure that you sent us all your logs? Because there isn’t much time spent here. How many projects does your solution have?

I see that the build log starts at 2021-03-25T02:05:02 and the END log ends at 2021-03-25T02:21:32, so that means it takes 16 minutes. But you say

which confuses me a bit. Am I missing something?