Follow along with the instructor as we configure Sonarqube.
We will be setting up Sonarqube in our airwaze project. You can try it out on any of your current branches.
Sonarqube is an open source tool for continuous inspection of code quality including: bug detection, code smells, and security vulnerabilities.
We will use Sonarqube to analyze our Java code. It will search for duplicate code, unused variables/parameters, code smells, and much more. Fixing the issues found by sonarqube helps to keep our code consistent between developers and hopefully more secure and stable. Consider sonarqube to be Eslint for Java, with more features. Note that sonarqube will analyze multiple language, however for this class we are only using it for Java.
Sonarqube runs as a service. Project configuration and reports are viewable in your browser via web interface. Defaults to http:localhost:9000
if installed locally.
Sonarqube can integrate with other tools such as gradle and jenkins.
docker run --name sonarqube -p 9000:9000 sonarqube
http://localhost:9000
Create new project
buttonairwaze
as the project key & click Set up
.airwaze
as the name for your token & click Generate
.Continue
Java
Gradle
build.gradle
filehttp://localhost:9000/projects
to see your project analysis.This gives you an overview of your code analysis. It will provide you with information on how much code coverage you have, how clean your code is, known vulnerabilities, and more.
This is another tool we can use to improve the quality of our code.