InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Code Quality Management Tool Sonar Provides Design and Architecture Metrics

Posted by Srini Penchikala on Jun 01, 2010

Sections
Development
Topics
Java ,
Tools
Tags
Sonar

The new version of open source code quality management tool Sonar provides design and architecture metrics. Sonar 2.0 introduced the analysis of design, architecture and object-oriented metrics for Java applications. And Sonar 2.1 version, which was released recently, supports the detection of unused methods.

Architecture metrics feature includes a new visual tool called Dependency Structure Matrix (DSM) which is a way to represent and navigate across dependencies between the components. It can be used to remove cycles between packages by cutting undesired dependencies and to identify the classes that have too many responsibilities (which is a violation of Single Responsibility Principle (SRP) pattern). The object-oriented metrics include Chidamber & Kemerer metrics like Depth of Inheritance Tree (DIT), Number of Children (NOC), Response for a Class (RFC), Afferent/Efferent Couplings (CA/CE), and  Lack of cohesion in methods (LCOM). The latest version also includes a new rules engine on top of Squid, a parser within Sonar which works on both source code and byte-code and comes with pre-built rules which can be used to detect unused private and protected methods and the client calls to deprecated methods. Squid analyzes the application source code, Java API and external libraries bytecode to determine which methods, classes and fields are deprecated. Other new features in Sonar 2.1 release are:

  • A new "Libraries" page to display all the project libraries and dependencies. This feature requires the project to be built with Maven application build tool. Once a project has been selected on Sonar site main page, this service allows to visualize the dependency tree of the project. There is also an optional dynamic filter available to filter the libraries by name to navigate through transitive dependencies of the application.
  • The "Dependencies" page which is used to search for library usages; for example to get all the projects which depend upon a third-party framwork like Commons Logging version 1.1.
  • Sonar functionality can be extended using various plugins that are available for integration with the tool. There is a new "System Info" page that displays the system properties, installed plugins and Java Virtual Machine (JVM) memory statistics. This page also provides detailed information about Sonar configuration and database statistics.
  • An administration console of installed plugins and system information.

The new release of Sonar includes a test framework and a custom Maven lifecycle for these plugins. It also includes a web service for integration with the project events and a new metrics module in the project size widget.

Freddy Mallet of Sonar team wrote about managing the cycles between packages and the clean up of design at a class level using the new version of the framework. The Sonar development team is also working on a plugin for Eclipse IDE, version 0.1 of which was released last month. The readers can also check out the Project Nemo which is an online instance of Sonar with the code analysis statistics on open source projects like Apache Commons frameworks, Apache Tomcat, Struts2, Esper and others.

 

Srini Penchikala currently works as Security Architect and has 17 yrs of experience in software product management.

Interesting plugin for technical debt by Vikas Hazrati Posted
Re: Interesting plugin for technical debt by Srini Penchikala Posted
  1. Back to top

    Interesting plugin for technical debt

    by Vikas Hazrati

    There is an interesting Sonar plugin which helps you access the technical debt of your project.

  2. Back to top

    Re: Interesting plugin for technical debt

    by Srini Penchikala

    Hi Vikas,

    I have used Sonar technical debt plugin before. I found it to be very useful in visualizing the amount of debt (in person dollars) after every release of the project. That project managers and team leads at my company rely heavily on this report to keep up with the changes in technical debt and code quality issues.

    -Srini

Educational Content

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?