The analyzer engine generates output of the analysis in a YAML file specified by --output-file option in the CLI.
The engine takes one or more Rules or Rulesets as input via the --rules option. See passing rules as input for more information.
The YAML output of analysis contains a list with each item in the list being a Ruleset type. Each of these rulesets in the output corresponds to its respective input ruleset:
- name: ruleset-1 (1)
description: | (2)
Text description about ruleset 1
tags: (3)
- tag1
violations: (4)
rule-1:
<violation>
errors: (5)
rule-2: "failed to evaluate"
unmatched: (6)
- rule-2
skipped: (7)
- rule-3- name: Name of the input ruleset for which output is generated.
- description: Description of the ruleset copied from input ruleset.
- tags: A list of tags generated by all the matched "Tagging" rules in the ruleset. (See Tag Action)
- violations: A map containing a Violation type for every matched rule in the ruleset. (Keys are Rule IDs and values are their respective Violations)
- errors: A map containing error strings for rules that the engine failed to evaluate. (Keys are Rule IDs and values are error strings indicating evaluation error)
- unmatched: A list of Rule IDs in the ruleset that were evaluated but not matched.
- skipped: A list of Rule IDs in the ruleset that were skipped because they didn't match the input label selector. (See Label Selector)
For every rule that is matched, the analyzer engine creates a Violation in the output.
-
description: Text description about the match copied as-is from the rule. (See Rule Metadata)
-
category: Pre-defined category string that indicates impact / severity of the problem. It is copied as-is from the rule. (See Rule Categories)
-
labels: A list of string labels copied as-is from the rule. (See Rule Metadata)
-
links: A list of hyperlinks provided copied as-is from the rule. (See Rule Links)
- Each item in the list is a struct with following fields:
- url: URL string.
- title: Title string.
- Each item in the list is a struct with following fields:
-
incidents: A list of Incident type indicating a match of the rule in the source code.
- There can be multiple matches of a rule. Each such incident has following fields:
- uri: File uri in the source code where the rule was matched.
- lineNumber: The line number in the file where match was found.
- message: A message copied as-is from the rule. (See Message Action)
- codeSnip: Relevant lines from the source code where the rule was matched.
- variables: A map containing values of matched CustomVariables in the rule. (See Custom Variables)
- There can be multiple matches of a rule. Each such incident has following fields:
-
effort: Integer indicating story points for each incident as determined by the rule author. (See Rule Metadata)
There is a standalone user interface available to visualize the YAML output in a static UI that runs in the browser. Check it out here. The README explains how it works with the YAML output.