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 Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay