Sonar-scanner takes 10 times as long for analyzing

SonarQube: Community Edition 7.9.2 (build 30863)
sonar-java-swagger-plugin-1.0.0.jar(java custome rule)
SonarQube deployed: Docker
Scan command:

sonar-scanner -Dsonar.projectKey=xxx-service -Dsonar.projectName=xxx-service -Dsonar.sourceEncoding=UTF-8 -Dsonar.sources=.\\env\\mavenRepo -X

use\\env\\mavenRepo paramter bacause I metioned in my another topic: Sonar scanner can’t use Java custome rule

First I use sonar-java-plugin with version: sonar-java-plugin- . In this sonarjava version, scanner scan my project takes 2-3 minutes.

But I encountered problems when I want to get collection generics : List<UserAddDTO>, there are no List<Type> typeArguments(); method in class interface , so I had no choice but upgrade the sonarjava version greater than 6.3.x to use typeArguments() method. At last , I take the version:

In sonar-java-plugin- version, scan the same project whth same paramter, it takes 30 minutes to finished . After I compared the debug log, I find with >6.3.x version, every file takes > 3s .

18:18:46  10:18:45.908 DEBUG: Analysis time of src/main/java/com/xxx/xxx/xxx/service/dao/ (3086ms)
18:18:46  10:18:45.909 DEBUG: 'src/main/java/com/xxx/xxx/xxx/service/dao/' generated metadata with charset 'UTF-8'
18:18:49  10:18:49.241 DEBUG: Analysis time of src/main/java/com/xxx/xxx/xxx/service/dao/ (3333ms)
18:18:49  10:18:49.242 DEBUG: 'src/main/java/com/xxx/xxx/xxx/service/dao/' generated metadata with charset 'UTF-8'
18:18:52  10:18:52.441 INFO: 42/207 files analyzed, current file: src/main/java/com/xxx/xxx/xxx/service/dao/
18:18:52  10:18:52.514 DEBUG: Analysis time of src/main/java/com/xxx/xxx/xxx/service/dao/ (3273ms)

After I realized this, I change the sonarjava version from 6.3.x - 6.15.x , it has same problem.

Then I rollback the version to sonar-java-plugin-, scan same project only takes 2-3 minuts.

I don’t know why, In this topic Sonar Scanner taking too long for analyzing,
Ann said MMF-1870 89 - SonarJava 6.3: improve performance . But in my case , It is not improve performance, but greatly reduced.


Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.9.2 → 8.9.10 → 9.9

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes for 7.9 to 8.9, as well as the LTS to LTS release upgrade notes for 8.9 to 9.9 helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.