Determine your technical debt using SonarQube - Introduction

Sep 6, 2017

TL; DR

This series will explain *how to set up an automated code quality analysis* which is almost free of charge with Visual Studio Team Services, Docker, Azure, and SonarQube.

Preamble

There is bad quality code in every development project. This goes from the quick and dirty hack we are not proud of, to the long-forgotten code written by a developer who quit the company.

The problem with this code is that it will eventually accumulate and slow down the pace of new features delivery. The reasons are various, a lot of time spent in bug fixes, refactoring, support…

To get out of this vicious circle, we must know what is the current baseline and then update the picture periodically. That’ll allow us to see what is the amount of work required to correct the situation, and whether we are improving the situation or making it worse, etc…

I had the chance to attend a presentation of SonarQube, which is the tool / platform we are going to study during this series of articles. You should know that SonarQube is not the only option out there. Here are the key advantages of this solution:

  • being opensource,
  • relatively known java developers
  • supported by a strong community

During the Microsoft build 2014 keynote, Microsoft quickly presented it, and they are working with the community to integrate SQ with the Microsoft tools/languages.

Writing this article had been delayed because of several conferences last two years but finally got the time to publish since I discovered and dug the subject.

In the meantime, Microsoft has published two articles.

One about installing everything locally, I’ll explain you how to do online.

https://blogs.msdn.com/b/visualstudioalm/archive/2015/09/29/QuickStart-analyzing-NET-projects-with-SonarQube-MSBuild-or-Visual-Studio-online-and-third-party-analyzers-stylecop-ReSharper.aspx

Another one to install SQ in on vm hosted by Azure (on Windows).

https://blogs.msdn.Microsoft.com/visualstudioalmrangers/2016/10/06/easily-deploy-SonarQube-server-in-Azure/

By the time you read this article, all posts of the series are already scheduled for publication, if ever you want to revisit a post or another, you can leverage my blog’s search feature.

Objectives

While progressing on my writing, I realized that there is a tremendous number of things to explain. Hence these suggested objectives for this series:

  • Introduction to the notion of technical debt (already done) and automated static analysis
  • Introduction to SonarQube
  • Getting you up and running in a few hours on a first project and this for free (apart from the cost of running the machines)
  • Giving you some tips to finalize the configuration on your projects

Your installation

To perform your installation, you have two options:

  • Either you are in a hurry and know already know what I’m about to explain in details, you can jump directly to the installation from GitHub https://Github.com/baywet/azure-docker-SonarQube
  • Or you’re discovering Azure, Docker, SonarQube and you want more than just the step by step explanation, in this case to follow this series of blogs

Last edited Apr 15, 2024 by Vincent Biret


Tags: