Generic issue import format
On this page
SonarQube supports a generic import format for raising external issues in code. You can use this format to import issues from your favorite linter even if there's no plugin for it. SonarQube also supports many third-party issue report formats, see importing third-party issues for more information.
External issues and the rules that raise them must be managed in the configuration of your linter.
Import
The analysis parameter sonar.externalIssuesReportPaths
accepts a comma-delimited list of paths to reports.
Each report must contain, at the top level, an array of Issue
objects named issues
.
Issue fields:
engineId
- StringruleId
- StringprimaryLocation
- Location objecttype
- String. One of BUG, VULNERABILITY, CODE_SMELLseverity
- String. One of BLOCKER, CRITICAL, MAJOR, MINOR, INFOeffortMinutes
- Integer, optional. Defaults to 0secondaryLocations
- Array of Location objects, optional
Location fields:
message
- StringfilePath
- StringtextRange
- TextRange object, optional for secondary locations only
TextRange fields:
startLine
- Integer. 1-indexedendLine
- Integer, optional. 1-indexedstartColumn
- Integer, optional. 0-indexedendColumn
- Integer, optional. 0-indexed
Example
Here is an example of the expected format:
Limitations
There are a couple of limitations with importing external issues:
- You can't manage them within SonarQube. For instance, there is no ability to mark them as false positives.
- You can't manage the activation of the rules that raise these issues within SonarQube. External rules aren't visible on the Rules page or reflected in quality profiles.
Was this page helpful?