Learn how to integrate SonarQube in your React Native project.
SonarQube is a static analysis tool that provides us with five main reports:
- Security & Security Review
- Test Coverage
In other words, it analyses our code to gives a report of anything that’s wrong or could be wrong in the future. Recently, I couldn’t find any good documentation on SonarQube and React Native, so I documented the steps that I made to integrate these two.
- Docker installed on your machine
- Homebrew installed
- brew install sonar-scanner (only first time)
- Download Docker and start it by running a command: docker run -d — name sonarqube -p 9000:9000 sonarqube
- Open http://localhost:9000/ and enter credentials: username: admin, password: admin
- Click + to create a new project and enter your
sonar-project.properties in the project root, add
sonar.projectName previously created and
sonar.projectKey generated in the last step
6. Run sonar-scanner in terminal
Open http://localhost:9000/ and voila; analysis results are here.