Only Software matters

Experiences in software development

  • Enter your email address to follow this blog and receive notifications of new posts by email.

    Join 637 other subscribers
  • MVB

  • JavaCodeGeeks

    Java Code Geeks

  • My recent tweets

5+1 Sonar Plugins you must not miss ( 2012 version )

Posted by Patroklos Papapetrou on January 1, 2012


This post is a revision of the original post, published last year and it covered Sonar version 2.8. Many months has passed and during this period the Sonar Team released four(4) new versions of the ultimate quality platform. The latest version ( 2.12 ) now includes JaCoCo in its core implementation and the existing plugin is now deprecated. Since I have included JaCoCo plugin in my previous post in top Sonar plugins I think it’s time to remove it and refine my list. So here is the 5+1 Sonar Plugins you must not miss for 2012!!

.I would like to clarify though some exceptions I have made prior to my final choice. I have excluded all plugins that have to do with additional languages and IDE to keep this post as much as objective I can. I have also excluded all commercial plugins for obvious reasons. After that assumptions I have limited my selections to the following categories :

  • Additional Metrics
  • Governance
  • Integration
  • Visualization / Reporting
Sonar itself comes with a variety of features that cover most of the needs of a software development team. However I consider that the following plugins are essential, especially for those that have adapted or trying to adapt agile practices. To be honest it was very difficult to select only 6 plugins!!
1.Hudson / Jenkins plugin
Although Sonar analysis can be easily triggered from several build tools (maven, ant etc.) I strongly believe that its native integration with the most famous open source CI server makes itself an important part of the continuous integration / deployment practice. The configuration is extremely easy and as proposed the best practice is to trigger Sonar at night builds. Team members can track day by day software quality, automatically, without bothering when a new analysis should run.
2.Timeline Plugin (2012 new entry)
How many times have you needed to see how much your source code has improved (hopefully) in the last weeks or months? Have you ever tried to compare basic quality indeces in a single graph? Timeline plugin integrates Google Visualization Annotated TimeLine component at project level and provides a flexible way to historical data regarding sonar quality metrics. Moreover it adds version and date milestones on visualization graph by providing in depth details about the evolution of a software project. Extremely useful for all team members ( developers, architects, testers even managers ).
3.Useless Code Plugin
It may looks similar to the Sonar Core feature named Duplicate Code, but it adds some more metrics, which I think are very useful especially for large or legacy systems. In general it measures how many lines can be removed from your code. It reports what is the number of unused private methods that can be safely removed and the number of unused protected methods exist in the code that can be removed after some more careful code examination. Finally it provides some more details about code duplication informing how duplicate lines are formed (i.e. x blocks of y lines )
4.SIG Maintainability Model Plugin
This plugin, as its name implies is an implementation of the Software Improvement Group(SIG) Maintainability Model. It reports ranking – from — :(very bad) to ++ (very good) on the following base indicators:Analysability, Changeability, Stability and Testability. The core idea for this ranking is to measure a series of base metrics such as Lines of Code(LOC), Duplications,Unit Tests,Complexity and Unit Size. Each of these metrics is then accounted into some of the mentioned indicators and the final result is representing the overall maintainability of the project. We can see the results of this analysis in a graphical (spider) presentation with all four axes of the model. With a glance a this graph you have a global and detailed at the same time view of how easy is to change and maintain your codebase. For me it is the first index I check every morning and if something is not + or ++ then we definitely have done something wrong 😉

5.Quality Index Plugin
Have you ever wanted to check a single number (indicator) and understand how healthy is your project? I am sure you have!! Well, the quality Index plugin is exactly what you are looking for. The plugin combines four weighted axes (complexity, coding violations, style violations, test coverage) of quality and produces a ranking between 0 (lowest) and 10(highest). Moreover it calculates a method complexity factor based on the complexity factor mentioned above. Have you ever tried to get a ranking of 10 with this plugin? I think it worths the effort! 🙂

6.Technical Debt Plugin
Last, but not least, the plugin that reports about the interest you have to pay as a developer, as a team, as a company. Technical debt is a term invented by Ward Cunningham to remind us that if we don’t pay our interest from time to time, then it is for sure that eventually this will make our software unmaintainable and hard to add new features or even find the root cause of defect. The plugin, which has a very powerful configuration, represents technical debt in four dimensions.

  • Debt Ratio : The percentage of current technical debt to the maximum possible technical debt.
  • Cost to reimburse : Cost in your currency to pay all interest and clean up your code
  • Work to reimburse : Same as above measured in man days.
  • Breakdown : Distribution to the following axes: Duplication, Violations, Complexity, Coverage, Documentation and Design

Be sure that you check its measures to avoid find yourself in bad situation like spaghetti code 🙂

I am pretty sure that there are plenty of interesting Sonar plugins so please feel free to post your comments with your list of them.

3 Responses to “5+1 Sonar Plugins you must not miss ( 2012 version )”

  1. […] years ago and Unit Testing a decade before. In my blog I have posted two Sonar-related articles. The first one is about the plugins you must not miss ( IMHO ) and the second describes the necessity of using it. […]

  2. […] 5+1 Sonar Plugins you must not miss (2012 version) – Timeline Plugin (with Google Visualization Annotated TimeLine), Useless Code Plugin, SIG Maintainability Model Plugin (metrics Analysability, Changeability, Stability, Testability), Quality Index Plugin (1-number health indicator), Technical Debt Plugin […]

  3. JM said

    Too bad the SIG MM plugin is not updated. 😦

Leave a comment