with one click
with one click
| name | sonar-fix-issue |
| description | Fix a specific SonarQube issue in code by rule key and location |
| argument-hint | [rule-key] [file-path:line] |
| allowed-tools | Read, Edit |
Fix a code quality or security issue identified by SonarQube.
sonar-fix-issue java:S1481 src/main/java/MyClass.java:42
sonar-fix-issue python:S2077 src/auth/login.py
sonar-fix-issue Remove unused variable in MyClass.java
Parse the user-provided arguments for:
java:S1481, python:S2077)src/auth/login.py:34)If neither a rule key nor a file path can be determined, ask: "Which rule and file should I fix?"
Call mcp__sonarqube__show_rule with the rule key to retrieve the full rule description,
rationale, and remediation guidance before touching any code. Do not add extra parameters (such as projectKey) unless the tool schema requires them — after integration, rule lookup usually needs only the rule key.
If the MCP server is unavailable, rely on built-in knowledge of SonarQube rules.
Read the full file content. If a line number was given, focus analysis around that line but read the whole file to understand context.
After editing, briefly explain:
<file> to confirm no new issues were introduced."sonar.projectKey in sonar-project.properties) — the CLI always uses -p."Installs sonarqube-cli if not already installed, authenticates, and integrates SonarQube with the current agent (installs analysis hooks & SonarQube MCP Server). Use when the user wants to set up SonarQube integration or asks to configure SonarQube.
Analyze a file or code snippet for quality and security issues using SonarQube
Find files with low test coverage and inspect uncovered lines in a SonarQube project (project key optional when MCP integration already defines the default project)
Search for software composition analysis (SCA) dependency risks in a SonarQube project (project key optional when MCP integration already defines the default project)
Find files with code duplications in a SonarQube project and inspect duplication blocks for a file (project key optional when MCP integration already defines the default project)
Search and filter SonarQube issues for a project, branch, or pull request via sonarqube-cli (`-p` is always required on the CLI; resolve the key from user arguments or sonar-project.properties)