SonarQube
Connects to a SonarQube or SonarCloud server's web API. An agent can list projects, retrieve code quality metrics, list issues, and check quality gate status.
Add to an agent node's tools array with _node_type: "tool-sonarqube". See Connector Reference — How connectors are used.
Authentication
| Field | Required | Description |
|---|---|---|
base_url | Yes | Base URL of the SonarQube/SonarCloud server (e.g. https://sonarcloud.io). |
token | No | User or project token, sent as HTTP Basic auth (token: with empty password). |
organization | No | SonarCloud organization key, appended as &organization=<organization> to applicable requests. Not used for self-hosted SonarQube. |
{
"name": "sonarqube",
"_node_type": "tool-sonarqube",
"base_url": "https://sonarcloud.io",
"token": "{{ secret.SONARQUBE_TOKEN }}",
"organization": "my-org"
}
Tools
sonarqube_list_projects
List SonarQube/SonarCloud projects with their quality gate status.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number (default 1) |
Returns: A newline-separated list of <name> key=<key> lines (20 per page).
sonarqube_get_metrics
Get code quality metrics for a SonarQube project (bugs, vulnerabilities, coverage, duplications, etc.).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
component | string | Yes | Project key e.g. my-project |
metrics | string | No | Comma-separated metric keys e.g. bugs,vulnerabilities,code_smells,coverage (default: bugs,vulnerabilities,code_smells,coverage,duplicated_lines_density,ncloc,reliability_rating,security_rating,sqale_rating) |
Returns: A two-column text table (Metric / Value) listing each requested metric and its value.
sonarqube_list_issues
List code issues (bugs, vulnerabilities, smells) in a SonarQube project.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
component | string | Yes | Project key |
types | string | No | BUG, VULNERABILITY, CODE_SMELL, SECURITY_HOTSPOT (comma-separated) |
severity | string | No | BLOCKER, CRITICAL, MAJOR, MINOR, INFO |
page | number | No | Page number (only sent if greater than 1) |
Returns: A first line Total issues: <N>, followed by one line per issue: [<type>] <severity> <rule> <message> (20 per page).
sonarqube_quality_gate
Check whether a project passes or fails its quality gate.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project key |
Returns: A first line Quality Gate: <status>, followed by one FAILED: <metric> (actual=<value> threshold=<threshold>) line for each failing condition.