Enterprise Integration Zone is brought to you in partnership with:

I'm a member of Transylvania JUG, a community from Cluj-Napoca/Romania interested in exchange of Java knowledge between members and keeping in touch with the latest Java technologies, frameworks and development trends. Attila-mihaly is a DZone MVB and is not an employee of DZone and has posted 19 posts at DZone. You can read more from them at their website. View Full User Profile

Tips for running SonarQube on large / legacy codebases

07.02.2013
| 6960 views |
  • submit to reddit

SonarQube (previously Sonar) is a quality management platform aimed mainly at Java (although other programming languages are supported to a varying degree. Here are a couple of tips to get it working on legacy projects:

  • There is an Ant runner and a standalone runner, it is not mandatory to use Maven (although it is a good idea in general to use it)
  • Look into the analysis parameters to customize it for your code.
  • Give it space and time :-) . For reference a ~2 million LOC Java project took 77 minutes to be analyzed on my laptop (an Intel i7) with 4G heap.
  • To avoid having a ton of problems reported and to focus only on new problems, look into the Cutoff plugin
  • Test and coverage reports can be reused, no need to run them twice (once for the CI system and then for SonarQube). Look intoreusing existing reports. Also, make sure to use the latest version of JaCoCo when generating profile data.
  • Configure your sonar.exclusions property to ignore code you aren’t interested in
  • Raise your sonar.findbugs.timeout property (the default of 5 minutes can be low for large projects)
  • Consider disabling source code related plugins (sonar.scm.enabled, sonar.scm-stats.enabled) if the provider for your SCM has an issue (HG has an issue currently for example with username containing spaces)

Keep your code clean!

Published at DZone with permission of Attila-mihaly Balazs, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Gaurav Goel replied on Wed, 2014/01/15 - 11:14pm

Hi

Thanks for the tips. Appreciate it.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.