getRule
getRuleRetrieve a Sonar rule's title, severity, type, language, tags, and structured explanation and fix sections by its rule key.
Instructions
Get a Sonar rule. Returns title, severity, type, language, tags, and structured explanation and fix sections.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ruleKey | Yes | Rule key, e.g. `java:S1234` |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Unique rule key (e.g. 'java:S1186'). | |
| lang | No | Language key (e.g. 'java', 'js', 'py'). | |
| name | No | Human-readable rule name. | |
| repo | No | Repository key (language or technology identifier, e.g. 'java', 'js', 'py'). | |
| tags | No | Tags categorising the rule (e.g. 'performance', 'java8', 'owasp-a1'). | |
| type | No | Rule type: BUG, VULNERABILITY, CODE_SMELL, or SECURITY_HOTSPOT. | |
| status | No | Rule lifecycle status: READY, DEPRECATED, or REMOVED. | |
| langName | No | Human-readable language name (e.g. 'Java', 'JavaScript', 'Python'). | |
| severity | No | Default severity. Standard mode: BLOCKER, CRITICAL, MAJOR, MINOR, INFO. MQR mode: BLOCKER, HIGH, MEDIUM, LOW, INFO. | |
| htmlDescription | No | Full rule description as raw HTML (including code examples and formatting). | |
| descriptionSections | No | Structured description broken into sections (rationale, non-compliant code, compliant code, etc.). |