Home > Backend Development > PHP Tutorial > SonarQube — PHP

SonarQube — PHP

Susan Sarandon
Release: 2024-12-19 02:40:34
Original
121 people have browsed it

SonarQube is a tool that analyzes codes. It checks bugs, security vulnerabilities, solid principles etc. in the code.

SonarQube — PHP

Download SonarQube | Sonar

Get the latest version of SonarQube, the leading product for code quality and security, from the official download page.

sonarsource.com

SonarScanner require for scan codes.

npm install sonarqube-scanner -g

Extra: Sonarlint is linter solution for vscode. You can download from vscode extensions.


After downloading, run sonarqube from terminal.

/Applications/sonarqube-9.9.0.65466/bin/macosx-universal-64/sonar.sh console

The first time I tried, I got this error:

Exception in thread "main" java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release

This error caoused by the java version. If your version java 18, you can downgrade to 17. Download 17 and run this command.

export JAVA_HOME=$(/usr/libexec/java_home -v 17)

Now we can reach it from http://localhost:9000.

Default credentials are username:admin , password:admin

Create a new project from the Sonarqube panel. Choose manuel and specify that will run from local. After that create token and select other for PHP and macOS.

We should get a result like this.

SonarQube — PHP

Copy scanner script and run it from code local terminal.

SonarQube — PHP

SonarQube — PHP

SonarQube — PHP

The above is the detailed content of SonarQube — PHP. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template