Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube Analysis takes too much time

Even though it seems to point to the enormous number of lines of code (500,000), engineering is unconvinced why it takes 90 mins on a beefy Solaris box with 16GB RAM and dual-CPU to finish one Sonar analysis. Please tell me if 90 mins is too much time for a codebase this size.

I am checking out code from Git using Jenkins git plugin, running a full ant build which takes 45 mins and then running 'ant sonar' which populates data to a SonarQube server running 4.1.2 and which has a 'Quality profile' as the default profile consisting of findbugs, checkstyle and PMD. Total time is 45 + 90 mins.

When i use the incremental option, the analysis time goes down and it does "see" that only one file has to be analysed. However, as per the documentation, the diff analysis is not populated in the database, hence rendering that option useless for my purposes.

How can I reduce the time taken for each SonarQube analysis?

like image 430
Sreeram K Avatar asked Jan 29 '15 00:01

Sreeram K


1 Answers

If your build already takes 45 minutes, then I'm not surprised that the SonarQube analysis takes a lot of time as well. 500k LOC is a lot for a single project.

Here are some various ways to reduce the time:

  • First make sure that you run SonarQube server on a real DB, not on H2
  • Then, the analysis should occur very close to the SonarQube DB
    • If possible on the same machine
    • If not possible, analysis and DB should be located on the same high-bandwidth & high-speed LAN
  • Also, make sure that you activate only relevant rules, and not all the available rules (some are even redundant)
like image 50
Fabrice - SonarSource Team Avatar answered Sep 30 '22 04:09

Fabrice - SonarSource Team