Sonar to Track Code Quality

Playing around with Sonar. I like the description from Sonar site about the tool – “SONAR is an open source quality management platform, dedicated to continuously analyze and measure source code quality, from the portfolio to the method.”

While Continuous Integration tools such as Hudson/Jenkins/CruiseControl let you track code quality statistics per project, what is missing is a centralized location to collect these metrics and track trends over time. Sonar helps you do that.

Follow the simple instructions on Sonar website to install and start Sonar. Install the Hudson Sonar plugin if you are using that. It simply adds a link from the Hudson project to its Sonar counterpart. I have an old Maven-based open source project at JavaForge. I pointed Hudson to that project. I configured the Hudson project to publish the build results to Sonar.

Here is a screen shots with metrics for the project. Sonar lets you publish your build results via Maven (mvn sonar:sonar) or Ant (ant tasks). If you are using Maven remember to update your settings.xml to point it to Sonar. One good place to see Sonar in real is at the demo site – http://nemo.sonarsource.org/filters/index/1.

1 thought on “Sonar to Track Code Quality

  1. Pingback: Sonar » Sonar in the news

Comments are closed.