Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 3.87 KB

File metadata and controls

65 lines (47 loc) · 3.87 KB

Analysis Output

The analyzer engine generates output of the analysis in a YAML file specified by --output-file option in the CLI.

Output Structure

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
  1. name: Name of the input ruleset for which output is generated.
  2. description: Description of the ruleset copied from input ruleset.
  3. tags: A list of tags generated by all the matched "Tagging" rules in the ruleset. (See Tag Action)
  4. violations: A map containing a Violation type for every matched rule in the ruleset. (Keys are Rule IDs and values are their respective Violations)
  5. 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)
  6. unmatched: A list of Rule IDs in the ruleset that were evaluated but not matched.
  7. skipped: A list of Rule IDs in the ruleset that were skipped because they didn't match the input label selector. (See Label Selector)

Violations

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.
  • 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)
  • effort: Integer indicating story points for each incident as determined by the rule author. (See Rule Metadata)

User Interface for Analysis Output

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.