Generic issue data
SonarCloud supports a generic format for importing issues generated by external analysis tools, like linters. This feature can help you integrate a tool that is not directly supported by SonarCloud by having your custom CI task convert the output of the unsupported tool to this generic format, which can then be imported into SonarCloud.
External issues have the limitation that the activation of the rules that raise these issues cannot be managed within SonarCloud. External rules are not visible on the Rules page or reflected in any Quality Profile.
External issues and the rules that raise them must be managed in the configuration of your external tool.
You can set up the import of the report files by defining the analysis parameter
sonar.externalIssuesReportPaths on the CI/CD host with the list of import directories or files. This parameter accepts a comma-delimited list of paths (a file path definition is either relative to the
sonar.projectBaseDir property, which is by default the directory from which the analysis was started, or absolute).
Each report must contain, at top-level, an array of Rule objects name
rules and an array of Issue objects named
issues. The report fields for each object type are listed below. For information about the Clean Code attribute, software quality, impact and severity, see Clean Code.
Issue types are deprecated and the severity feature has evolved (see Clean Code for details). The related fields will be updated in the future.
description- string, optional
cleanCodeAttribute- string e.g., CONVENTIONAL, CLEAR, DISTINCT, LAWFUL (for more information, see here)
impacts- list of Impact objects, consisting a software quality and severity level to which the rule's clean code attribute contributes, for example, MAINTAINABILITY and HIGH.
primaryLocation- Location object
effortMinutes- integer, optional. Defaults to 0
secondaryLocations- array of Location objects, optional
textRange- TextRange object, for secondary locations
startLine- integer. 1-indexed
endLine- integer, optional. 1-indexed
startColumn- integer, optional. 0-indexed
endColumn- integer, optional. 0-indexed
Here is an example of the expected format: