Sonargraph 12 is out! This release contains a couple of major changes: A reworked Exploration view, a refactored System view (dashboard) with new metrics and visualizations, faster C/C++ parsing and various other improvements.Read More
During the last months we released a couple of major features in Sonargraph that allowed easier interaction like the ‘Architectural View’ and improved the interpretation of results like the ‘System Diff’, ‘Quality Gates’ or ‘Issue Ranking’. We have described the power of these features in individual blog posts.
Some implemented improvements are less obvious, but nevertheless can have a big impact while working with Sonargraph.
This blog post highlights four hidden gems that the casual Sonargraph user might not know about:
- Improved issue to resolution matching
- Filtering in tables
- Visualizing cycle croups in Exploration view
- Passing selection between Sonargraph and Eclipse IDE
With the Sonargraph 9.10 release, we added support for two additional OO-metrics “Depth of Inheritance” and “Number of Children” as described by Chidamber and Kemerer. Sonargraph provides a powerful Script API that allows implementing new metrics as Groovy scripts and I needed surprisingly little amount of code for the implementation. This blog post will explain the scripts’ code and the used Sonargraph Script API in detail.Read More
Today, we released a new version of Sonargraph with an improved script to find Singletons. “Singleton” is one of the design patterns described by the “Gang of Four” . It represents an object that should only exist once.
There are a couple of pros and cons for a Singleton that I won’t go into detail in this blog post. For anyone interested, I recommend “Item 3: Enforce a singleton property with a private constructor or an enum type” in “Effective Java”, written by Joshua Bloch . Two interesting links that came up during a quick internet research are listed as references  . Let’s just summarize that it is important to ensure that Singletons are properly implemented to avoid bad surprises (a.k.a bugs) in your software. And you should keep an eye on the existing Singletons and check that they are not misused as global variables.
This blog post describes, how you can detect Singletons by utilizing the Groovy scripting functionality of Sonargraph.
Sonargraph is our tool to quickly assess the quality of a project. I get frequently asked, how Sonargraph supports the Enterprise Architect who needs to answer quality-related questions in the broader context across several projects.
Since we recently released new functionality that allows the automation of re-occurring quality checks, it is now the right time to write a blog post.
Example questions that an enterprise architect wants to answer:
- How frequently does a certain anti-pattern occur?
- How strong is the dependency on deprecated functionality?
- How many of my projects suffer from high coupling?
This article will demonstrate the following core functionality of Sonargraph to answer the above questions for a couple of projects and how to automate this analysis.
- Use a script to detect an anti-pattern (“Supertype uses Subtype”)
- Create a simple reference architecture to detect usage of sun.misc.Unsafe
- Add a threshold for a coupling metric (NCCD)
- Export a quality model
- Use Sonargraph Build Maven integration to execute the analysis.
- Create a small Java project to execute the Sonargraph Maven goal, access the data in the generated XML reports and create a summary.