Understand the three levels of SARIF data abstraction
mainWhen working with SarifFileSet, SarifFile, or SarifRun, data is presented at three levels of aggregation:
- Results: Raw dicts deserialized directly from the SARIF JSON Result objects (per SARIF standard section 3.27).
- Records: Flat dicts containing
sarif_file.BASIC_RECORD_ATTRIBUTES. This is ideal for machine-readable formats like CSV. Attributes include:Tool: Tool name.Severity:error,warning(default),note, ornone.Code: Issue code.Description: Issue name.Location: File location.Line: Line number (string, defaults to"1").
- Reports:
IssuesReportobjects. These group and sort records to provide structured, human-readable data (e.g., for Word or HTML).