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.