As you maybe understood it there are 2 components to the SonarQube ecosystem, the server and the scanner(s). They typically run on 2 different machines, but for small tests they can be on the same machine (your MAMP machine is OK)
- The server is “SonarQube”. You must have it installed on some machine of some kind. Unless you have changed the port by configuration, SonarQube is running on port 9000.
So first verify that your SonarQube is running by checking there’s a web app responding what invoking
Log in and change the password of user admin
- If that works, then you can scan.
On the machine where you WP code is, install (ie download and unzip) the scanner, for instance
/home/jochen/scanner if you’re on Linux).
Once done, change to the root directory of your WordPress installation (all the source code that you want to scan should be under that root directory (of course possibly under any level of subdirectory)
At this root create a sonar-project.properties file and follow the instructions at SonarScanner | SonarQube Docs
Then (depending on whether you’re on Linux or Windows) simply run sonar-scanner.bat or
C:\tools\scanner\sonar-scanner-220.127.116.116...\sonar-scanner.bat -Dsonar.host.url=http://<nameOrIP>:9000 -Dsonar.login=admin -Dsonar.password=<yourAdminPassword>
/home/jochen/scanner/sonar-scanner-18.104.22.1686.../sonar-scanner -Dsonar.host.url=http://<nameOrIP>:9000 -Dsonar.login=admin -Dsonar.password=<yourAdminPassword>
Hope this helps.