Once the build is complete and successful, the new or updated project can be found in the Dashboard. Drilling down into the project would bring up a screen like which is loaded with important metrics and analysis on various aspects of the project:
(above is a screenshot of a JDK7 as published on the nemo.sonarqube.org site)
I quite like the below Design component which gives a good break-down of the package dependencies across each other and highlights dependency-cycles. Its one of the more complex things to do on a medium to large project and can usually come in the way of modularisation.
(above is a screenshot of a sample application)
If you ever wanted to know the internal or external libraries a project uses, you might need to look at the contents of your project including the pom.xml file. No longer the case if you are using SonarQube, as Library is such a component that enlists components that your application depends on and is more reliable than searching for it manually.
(above is a screenshot of a sample application)
It is also possible to add any Widget on any Dashboard (Widgets are components that make up a Dashboard), like the one presented below.
(above is a screenshot of a sample application)
Issues Drilldown
Just being told that something is wrong and here’s the score on how much wrong or incorrect something is, does not help. A more constructive feedback is, here’s what’s wrong and this is what you can do to fix it.
The Issues Drilldown is one such dashboard where we can find such information or enough to know what’s wrong and where to go and how to fix it (sometimes). It also archives older and closed issues, and indicates how bad a problem it is by giving it various gradations of severity i.e. Blocker to Info.
(above is a screenshot of a sample application on nemo.sonarsource.org)
The Manage dashboards option at the top right corner of any of the Dashboard pages (as below) is used to create new dashboard pages into which widgets can be placed.
Similarly the Configure widgets link on every Dashboard page allows adding, removing or changing the position of the widgets anywhere on the Dashboard page.
(above is a screenshot of the Apache Commons Collection)
Tag or word Clouds is a very popular concept heavily used as a form of visualisation to convey metrics – as shown above, which is an illustration of the Apache Commons Collection library.
Commercial component – SQALE
SQALE is a proprietary component and not available in the community version, although a demo version is available via
SonarQube’s Nemo project [
07].
SQALE is a technical debt evaluation tool, more details of it can be found at [
08].
(above is a screenshot of Apache Commons Collections)
Settings
Under the hood, this SonarQube instance relies on a number of default or customised configuration settings laid out as below.
(above is a screenshot of a sample application)
Configuration settings to individual components can be accessed and changed via this interface.
Update Centre
Many widgets that are populated in the various Dashboards seen so far can be enabled or disabled from the below page. It is also where updates and upgrades for all the widgets are available, including updates and upgrades for SonarQube itself.
(above is a screenshot of a sample application)
Upgrade process
Check out the upgrade process from [10], see also [11] to learn what should be done before and after the process.
Usually stopping and restarting SonarQube are common steps performed before and after applying an update or upgrade to one or more components or to SonarQube itself.
Conclusion
After assessing these features its clear that this product has a number of advantages over other solutions out there i.e. lots of free plugins, a plug-in based dashboard system, besides it being an open-source project, and a very good one to get started with. Having said that, there might be commercial products out there that have better quality assessment propositions but not necessarily useful unless yours is a big organisation.
Use SonarQube as a tool to create short-feedback loops, and apply improvements to your code base after assessing the rationale for the change suggested. In case the feedback is incorrect or is a false positive or false negative – one option would be to tweak the configuration settings behind the relevant component to see if the issue raised is applicable under a current conditions – basically either turning of the check or not taking the feedback literally.
Disclaimer: please do not take any of these metrics or the contents of the blog literally but rather as another point of view of the quality of your code-base. Its important to know how to read the data and not read too much into the numbers and flags raised – there may still be false positives or false negatives. Some commercial products have taken this seriously and have invested to reduce the false positives and false negatives.
External resources