SonarQube is an open platform to manage code quality. As such, it covers the 7 axes of code quality:

  1. Architecture and Design
  2. Duplications
  3. Unit Tests
  4. Complexity
  5. Potential bugs
  6. Coding rules
  7. Comments

SonarQube has got a very efficient way of navigating, a balance between high-level view, dashboard, TimeMachine and defect hunting tools. This enables to quickly uncover projects and/or components that are in Technical Debt to establish action plans.

More than 20 programming languages are covered through plugins.

Get Started in Two Minutes.

  • After download of SonarQube server, sonarqube-downloads
  • #On Windows, execute – C:\sonarqube\bin\windows-x86-xx\StartSonar.bat
    #On other operating system, execute – /etc/sonarqube/bin/[OS]/sonar.sh console
    SonarQube host url = http://localhost:9000
  • Install a Database (we choose MySql on Mac OS)
    brew install mysql
    mysql.server restart (or from System Preference -> MySQL -> Start MySQL Server)
    create user ‘sonarqube’@’localhost’ identified by ‘sonarqube’;
    create database sonarqube;
    grant all privileges on sonarqube.* to ‘sonarqube’@’localhost’; (assign to user create the DB)
    use sonarqube; (check)
    show tables; (check)
  • Install SonarQube Plugin (* purchase plugins)
    Sonar-Installing-Plugin
  • On Jenkins install the plugin for SonarQube
    sonarqube-jenkins-plugin so to set SonarQube Runner and SonarQube on Jenkins Configuration
  • In sonar-scanner.properties let’s set the values for the DB created to SonarQube
  • Continue in SonarQube and Gradle for Android (an example)

sonaqube-jenkins1

 

 

 

 

sonarqube-jenkins2

 

 

 

Happy Automatic Static Testing with SonarQube;)

share me!:))Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone
Print this page