# SonarQube Cheatsheet ## Start / Stop SonarQube server ``` // start C:\sonarqube\bin\windows-x86-64\StartSonar.bat // stop C:\sonarqube\bin\windows-x86-64\StopSonar.bat ``` ## run scanner: ``` cd C:\...\project sonar-scanner ``` ## API Documentation & Examples Documentation: ``` // list analysis curl -u admin:admin http://localhost:9000/api/project_analyses/search?project=php-crud-generator // delete analysis curl -X POST -u admin:admin http://localhost:9000/api/project_analyses/delete?analysis=AXNiozDvLO6cj1hFxYNP ``` ## *sonar-project.properties* Example ``` # must be unique in a given SonarQube instance sonar.projectKey=my-project # this is the name displayed in the SonarQube UI sonar.projectName=My Project sonar.projectVersion=1.0 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # If not set, SonarQube starts looking for source code from the directory containing # the sonar-project.properties file. sonar.projectBaseDir=C:/Users/.../my-project # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 # Global exclusions sonar.global.exclusions=**/*.java,**/vendor/**/*,**/cgi-bin/**/*,**/.vscode/**/* # Project exclusions sonar.exclusions=**/server-update/**/*,**/*.ts sonar.scm.disabled=true ```