Why SonarScanner for SonarQube 8.4 so slowly?

I’m using SonarQube 8.4 to scan Java projects,but it takes much longer than SonarQube 5.6.
For example,PMD scan takes about 4 minutes and AST scan takes about 2 minutes.Total progress takes about 10 minutes.It’s much longer than before(1 minute).
SonarScanner’s version is 4.5.
So it’s normal?Can I do something to accelerate this progress?

Hi Congmu,

I would suggest for you to share a full scan log in debug mode (passing the -X parameter) with timestamps, in order to understand where the scanner expends time and how much.

Important note: PMD is a community plugin which we do not manage nor support ourselves. Hence if the scanner expends 4 minutes on it, you’d need to see with the PMD plugin folks why this may be. And since SonarQube 5.6, lots of official new rules have been added for Java analysis on our side. You should review whether you need all these PMD rules in your quality profiles after such a huge SonarQube upgrade.

Cheers,
Daniel

Thanks very much.The detail of time spent as the picture shows.Can you take time to look?


Hi Congmu,

I would need the full scan log in order to give you the most accurate answer. With the screenshots you provided, I am only able to say this:

  • You are using PMD and FindBugs (third party plugins) for your Java analysis. They both amount to about 10 minutes of execution time, which means a whopping 71% of the total analysis time. Without them, our analysis would take about 4 minutes which seems normal to me for a project with at least 776 Java source files.

First of all, you should check with the maintainers of these plugins on the reasons why they may perform slower on SonarQube 8.4 (naive question: are you sure you are using their latest versions?). These two third-party plugins may have been useful in the times of SonarQube 5.6, but on SonarQube 8.4, the official Java rules are more powerful and more numerous. Have you checked your Quality Profiles after this major upgrade, and whether you need these plugins’ rules at all?

Cheers,
Daniel

Thanks again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.