Documentation
¶
Overview ¶
Package report renders findings as text, JSON, SARIF, CSV or JUnit XML.
Index ¶
- Constants
- Variables
- func CSV(w io.Writer, fs []detect.Finding) error
- func JSON(w io.Writer, fs []detect.Finding) error
- func JUnit(w io.Writer, fs []detect.Finding) error
- func PolicyLine(fs []detect.Finding, policy string, hidden int, suppressed map[string]int) string
- func SARIF(w io.Writer, fs []detect.Finding, rules []*config.CompiledRule, version string) error
- func Stats(w io.Writer, fs []detect.Finding, version, policy string) error
- func Summary(fs []detect.Finding) string
- func Text(w io.Writer, fs []detect.Finding, o Options) error
- func Write(w io.Writer, format string, fs []detect.Finding, rules []*config.CompiledRule, ...) error
- type Options
- type StatsReport
Constants ¶
View Source
const ConfidenceScale = "" /* 170-byte string literal not displayed */
Write renders findings in the given format. ConfidenceScale describes the confidence field for report consumers.
Variables ¶
View Source
var Formats = []string{"text", "json", "sarif", "csv", "junit", "stats"}
Formats lists supported report formats.
Functions ¶
func PolicyLine ¶
PolicyLine summarizes what blocks, what needs review and what filters removed, so nothing is silently dropped.
Types ¶
type Options ¶
type Options struct {
Color bool
Remediation string // text: short (default) | full | none
Policy string // strict | balanced: text output groups non-blocking findings for review
Explain bool // print the evidence for every finding (git hooks: explain every block)
}
Options control rendering.
type StatsReport ¶
type StatsReport struct {
Schema int `json:"schema"`
Version string `json:"version"`
Policy string `json:"policy"`
Findings int `json:"findings"`
Blocking int `json:"blocking"`
ByRule map[string]int `json:"byRule"`
ByConfidence map[string]int `json:"byConfidence"`
ByFileType map[string]int `json:"byFileType"` // extension only, e.g. ".py"
}
StatsReport is an anonymized summary for sharing results publicly (for example in a benchmark issue): counts only. It contains no file paths, secret values, fingerprints, line numbers or commit data.
Click to show internal directories.
Click to hide internal directories.