DEV Community

Cover image for SonarQube — PHP
Fehmi Velioglu
Fehmi Velioglu

Posted on

SonarQube — PHP

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

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

Copy scanner script and run it from code local terminal.

SonarQube

SonarQube

SonarQube

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay