This Visual Studio Code extension synchronizes issues from the SonarQube service to the Problems panel, providing developers with real-time feedback on code quality.
Features
Fetches issues from the SonarQube API.
Displays issues in the Problems panel of VS Code.
Automatically synchronizes issues at specified intervals.
Flexible Authentication: Supports both standard API Token and session Cookie authentication, solving scenarios where standard tokens are blocked by WAF or require SSO.
Branch Filtering: Easily switch between project branches to view specific issues.
Installation
Clone the repository:
git clone <repository-url>
Navigate to the project directory:
cd sonar-sync-extension
Install the dependencies:
npm install
Open the project in Visual Studio Code.
Development Notes
Important: You must use npm to install dependencies. Using other package managers like pnpm or yarn may cause errors when packaging the extension with vsce.
Configuration
The extension supports two ways to configure the SonarQube settings. It will prioritize the sonar.json file if it exists in the workspace root.
Method 1: Local sonar.json File
Create a file named sonar.json in your workspace root directory with the following content:
Note on Authentication: If your SonarQube instance is behind a proxy (like SSO or WAF) that invalidates standard Token-based requests, you can provide a session cookie to bypass these restrictions. The extension will automatically include this cookie in all API requests.
Usage
After installation, the extension will automatically start synchronizing issues from SonarQube.
You can view the issues in the Problems panel.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for details.