XML Output Schema Reference
This example shows how to create a XML-formatted output file when using the --output-file
flag of the code-analyzer run
command.
This sample output shows 3 violations with different severities from different engines.
Element | Data Type | Description |
---|
<runDir> | string | The directory from which the Code Analyzer analysis ran. |
<violationCounts> | complexType | Contains elements that show the total number of violations and the aggregate counts for each severity level. See <violationCounts> Element for details. |
<versions> | complexType | Contains elements that show the versions of the core Code Analyzer module and each engine module that ran in the analysis. See <versions> Element for details. |
<violations> | complexType[] | An array of <violation> elements, where each element corresponds to a violation that was detected in the analysis. See <violation> Element for details. |
Element | Data Type | Description |
---|
<total> | number | Total number of violations found in the analysis. |
<sev1> | number | Number of severity 1 (Critical) violations found. |
<sev2> | number | Number of severity 2 (High) violations found. |
<sev3> | number | Number of severity 3 (Moderate) violations found. |
<sev4> | number | Number of severity 4 (Low) violations found. |
<sev5> | number | Number of severity 5 (Info) violations found. |
Element | Data Type | Description |
---|
<rule> | string | The name of the rule that's associated with the violation. |
<engine> | string | The engine that's associated with the violation. |
<severity> | number | The severity level of the violation: 1 (Critical), 2 (High), 3 (Moderate), 4 (Low), 5 (Info) |
<tags> | string[] | An array of elements that contain the tags that are associated with the rule that's associated with the violation. |
<primaryLocationIndex> | number | The index of the primary code location within the code locations array. |
<locations> | complexType[] | An array of <location> elements, where each element corresponds to a location in your code that's associated with the violation. See location Object Properties for details. |
<message> | string | The violation message. |
<resources> | string[] | An array of elements that contain URLs for additional resources and information about the violation. |
Some rules, such as those that have a PathBased
tag, can produce multiple code locations. These code locations make up the code path associated with the violation.
Property | Data Type | Description |
---|
<file> | string | The pathname of the file in which the violation occurred, relative to the runDir directory. |
<startLine> | number | The line where the violating code starts. |
<startColumn> | number | The column in the startLine where the violating code starts. |
<endLine> | number | The line where the violating code ends. |
<endColumn> | number | The column in the endLine where the violating code ends. |
<comment> | string | Comment that provides additional context associated with this line or block of code. |