Skip to main content

Module sarif

Module sarif 

Source
Expand description

SARIF 2.1.0 writer for OffenderRecord batches.

SARIF (Static Analysis Results Interchange Format) is the OASIS standard ingested natively by GitHub Code Scanning and most modern IDE/security tooling. Lizard does not have a SARIF output, so this is the obvious modern target for big-code-analysis integrations.

We model only the subset of SARIF we actually emit as a small set of Serialize structs (no sarif crate dependency). The shape:

{
  "version": "2.1.0",
  "$schema": "https://json.schemastore.org/sarif-2.1.0.json",
  "runs": [{
    "tool": { "driver": { "name": "big-code-analysis", "version": "...",
                           "rules": [ { "id": "cyclomatic", ... } ] } },
    "results": [ { "ruleId": "...", "level": "warning", ... } ]
  }]
}

Functionsยง

write_sarif
Write a SARIF 2.1.0 document for offenders to writer.