Sonarqube

I downloaded and installed Sonarqube - and it's amazing. It finds, displays, and tracks all sorts of defects for several languages. Or as their website states, it is "an open platform to manage code quality". I can analyze C#, JavaScript, HTML, and CSS as well as several others I'm not using. It's not just showing me issues with my code, but it tracks issue counts over time so I can see things are getting better. In addition to the built-in support, there is a plugin available for including ReSharper issues using the ReSharper Command Line Tools. And another plugin for StyleCop. Further, I can track code coverage of unit tests. In the event that my coverage slips, it shows up as an issue to be resolved. And I see the change in coverage over time on nice visual graph.

[Sonarqube Dashboard]

The support for Visual Studio solutions is lacking and really difficult to get working properly. The MSTest coverage doesn't work out of the box (requires a transform). There are some naming requirements to associate a test project with the source it covers too. If you skip the solution support and go straight to a project-by-project analysis, it is way more flexible and customizable. The downside being you have to modify the analysis to accomodate the changes to the solution.

I created a custom MSBuild script as well as some helper MSBuild tasks (including the code coverage transform required) - available for download.

Overall, it's fantastic. Every release, the tool has gotten better and better. They just released version 4.5.2 under their Long Term Support program and started working on version 5.



Tags

  • .NET
  • Design Considerations
  • Software

Revisions

  • 1/9/2015 - Article written.