Sonar CLI analysis take too long

Hi,

The analysis in my android project takes too long.


As with the images I shared above, it took around 20 minutes for only 30 files to complete.
And this only happened with the android project.

Hey there.

Has this always been the case? Did this start recently? When?

Hi,

It just happened recently when scanning the android project.

Thanks. Last week, we deployed a release to the Kotlin analyzer on SonarQube Cloud that might affect this.

Can you clarify how you run the analysis? Are you using the SonarScanner CLI or a build-specific tool like the SonarScanner for Gradle?

we’ve tried both CLI and Plugin, and we got the same issue. So how can we address this issue?

Unfortunately, there’s no workaround at the moment. I’ve called in some experts. If there are additional reports, we may consider other mitigations like a rollback, but so far this is the only one.

Thank you. Pls notify us if there is any update on this issue

Hey @asd_asdasd,
This will not help you solve the performance regression you are facing but perhaps you can help us gain a better understanding of the situation in your next analysis. Because the issue seems to happen whether you use the SonarScanner CLI or the Gradle plugin, the following instructions are will be about the Gradle scanner.

First, let’s have a look at whether Gradle scanner correctly understands the configuration of your project by adding the sonar.scanner.internal.dumpToFile parameter.

./gradlew sonar \ 
  -Dsonar.scanner.internal.dumpToFile=/tmp/analysis.properties

This will not run any analysis but should help understand if something is off in the configuration.

Second, can you add sonar.kotlin.performance.measure=true and sonar.kotlin.performance.measure.json=/path/where/you/want/to/save/the/results to your analysis parameters?

./gradlew sonar \
  -Dsonar.kotlin.performance.measure=true \
  -Dsonar.kotlin.performance.measure.json=/tmp/kotlin-measure.json

The file dumped at the end of the analysis should help us now narrow down the cause of the slowdown.

Cheers,

Dorian

Sorry for delay in reply. Can I run these params via the sonarcli? @Dorian_Burihabwa

hey @asd_asdasd,

Yes these properties should work as well with the scanner-cli

Blockquote ./gradlew sonar \
-Dsonar.scanner.internal.dumpToFile=/tmp/analysis.properties

For the command above, pls share a link or private msg so that I can share the result.

Blockquote ./gradlew sonar
-Dsonar.kotlin.performance.measure=true
-Dsonar.kotlin.performance.measure.json=/tmp/kotlin-measure.json

When running the analysis with the parameters above, It stuck on the very first analyzing file. So I don’t think there is a report that can be generated.