Execution time mismatch

Hello,

I have integrated the execution of SonarQube analysis in Jenkins. I have a pipeline script that executes a gradle command to launch the sonar analysis.

For this I use this gradle plugin → org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373

Everything works fine but the analysis takes a long time

11:45:46  D:\Jenkins\workspace\orkspace_environment_test_fedris>D:\gradle\gradle-6.9.4/bin/gradle sonarqube -Dsonar.login=sqa_be1f33d639bc4a0ff054aeab2ca932fd4ff296c1 -Dsonar.host.url=http://w2019-sonarqube.fedris.be:9000 -Dsonar.qualitygate.wait=true -Dsonar.gradle.skipCompile=true
...
11:50:41  BUILD SUCCESSFUL in 4m 45s

When I look at the SonarQube level, I have totally different time.

Submitted : 11.49:30 AM
Started : 11:49:30 AM
Finished : 11:50:29 AM
Duration : 58s

Does anyone have an explanation for this? What should I do to reduce the analysis time?

Thanks

Hey there.

SonarQube analysis has two phases: the scanner runs in a local developer or CI/CD environment, and then the report is set to SonarQube for processing.

So it would seem that your analysis (scanner-side) started sometime after 11:45:46, submitted the analysis report around 11:49:30, and finished up processing at 11:50:29. Based on your scanner command, your build is waiting for the report to be processed, or you just have some other stuff going on in your build that takes up the time until 11:50:29.

Everything’s relative. How big is your project (Lines of Code or modules is a good measure)? How long does a build (without SonarQube analysis) take? What version of SonarQube are you using (this info can be found in the footer of your instance)?