Code quality

Code quality can be easily analyzed using SonarCloud, which is automatically configured by JHipster.

Using Sonar with JHipster

JHipster provides a specific Docker Compose configuration for Sonar (here is the JHipster Docker Compose documentation) that provides an out-of-the box Sonar instance. At the root of your project, please run:

docker-compose -f src/main/docker/sonar.yml up -d

If you use Maven, it has been automatically configured:

./mvnw clean test sonar:sonar

If you use Gradle, it has also been automatically configured:

./gradlew clean test sonarqube

Once the analysis completes, it will be available on the Sonar dashboard, which by default is available on http://127.0.0.1:9000/.

Automatic analysis of the default generated project

The JHipster generator project publishes a sample project which is analyzed every time a new commit is merged in the “master” branch:

Analysis of the sample JHipster project

This allows the JHipster team to make sure that you will start developing your project on the cleanest code possible.

This analysis is provided for free by SonarCloud.