Today I will guide you on how to configure VSCode with SonarQube Server.
Step 1. Install SonarLint Extension.
Step 2. Open global setup for VS Code
Ex:\AppData\Roaming\Code\User\settings.json
"sonarlint.connectedMode.connections.sonarqube": [{ "serverUrl": "https://sonar.domain.net", "token": "xxxx"}]
Step 3. How to get token for the application
Access to current SonarQube Server
Ex. Open link https://sonar.domain.net/
Login with your account and go to Account Settings
Go to the security tab and generate token — copy token to VS Code settings
Step 4. Go to the code base of your application
Add a workspace/user settings for the application
Add this config to your workspace/users settings
“sonarlint.connectedMode.project”: { “projectKey”: “TestApp”}
How to get projectKey
- Go to the SonarQube Server
2. Click in the Project you want to check — You can get Project Key -> ID in the URL