Giter Site home page Giter Site logo

code-quality-game's Introduction

Code Quality Game Build Status

A simple gamified web to improve code quality using SonarQube.

Introduction

This is a (micro) web page that shows a ranking of developers by the quantity of technical debt they are fixing in SonarQube. It encourages a 'nice competition' and tries to solve one of the main problems of fixing legacy code: it's boring.

You can find more information about the goal of this project in my blog post

Requirements

  • Java 1.8+
  • Maven: it's needed only to build the project, later you can deploy directly the jar file.
  • A SonarQube server to connect to. The application is tested with version 5.2.
    • You may need to create a user in SonarQube for this application to connect (if your server doesn't provide anonymous access).

Configuration

First you'll need to list the users that are going to participate in the game. This is done through the users.xml file.

<user id="pauldark" alias="Paul Dark" team="Team Alpha" />

It's important that the id matches with the SonarQube username. The alias will be used for the rankings and the team is used for aggregated Ranking per teams.

In case your Sonarqube server doesn´t have anonymous access you need to specify credentials for accessing the API. You can create an user with basic permissions for that.

# Sample credentials for accessing the API
sonarUser=cqgameUser
sonarPassword=cqgam3

Given that this application does not have memory it will use only the issues existing in Sonar. This is why I recommend you to extend the time window to delete old issues in Sonar (Project Settings -> General -> Database Cleaner -> 'Delete closed issues after' = 90). All the points/badges obtained will belong to that period of time, this is good to promote 'continuous fixing'.

Legacy Date

This application is intended to be used for fixing Legacy Code (old, ugly, error-prone). To avoid giving points for fixing recent violations you can configure the maximum date that you are considering for Legacy Code within the configuration.

How to play

The application looks for issues assigned to every user and it assign points for them once they are resolved. So playing is easy:

  • Ensure that the code you're going to refactor is covered by Unit Tests.
  • Assign to you in SonarQube the different issues that you're going to fix.
  • Fix the issues! Once the code is reviewed with Sonar the issue will become Resolved and you will obtain points for that.

Badges

This is a work in progress, some things should be improved. Right now there are two sample badges that you can win. One is related with the date in which you start playing, if you are an early adopter you will obtain some extra points (obviously you will lose them after the SonarQube issue cleaner comes into play). The second one is related with the Unit Test Coverage and there are different ranges. Explore the code to know more about them.

code-quality-game's People

Contributors

mechero avatar michaelckr avatar davidhendrix avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.