一键导入
一键导入
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 the SonarQube MCP Server (project key optional when MCP integration already defines the default project)
List SonarQube projects accessible to the current user via the SonarQube MCP Server
| name | sonar-fix-issue |
| description | Fix a specific SonarQube issue in code by rule key and location |
| argument-hint | [rule-key] [file-path:line] |
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
This skill requires the SonarQube MCP Server to be configured and the tool mcp__sonarqube__show_rule to be available in your session.
If the tool call fails, surface the tool error verbatim and stop. Auth, credentials, and MCP server configuration are runtime infrastructure concerns and are not user-fixable from chat — do not ask the user to verify env vars or to install or run any CLI. Do not fabricate rule descriptions from built-in knowledge.
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 — rule lookup usually needs only the rule key.
If the call fails, surface the error verbatim and stop — do not fall back to built-in knowledge of the rule, since it may be stale or wrong for the user's SonarQube configuration. Auth and configuration issues are infrastructure problems, not user-fixable from chat.
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."