Documentation
¶
Overview ¶
Package report holds what every output writer (json, sarif, table, summary) shares
Index ¶
- func AnalyzerGaps(analyzers []model.AnalyzerResult) []string
- func ContributionNote(res *model.ScanResult) string
- func CoverageIsMerged(c model.Coverage) bool
- func CoverageOverstatesCapabilities(c model.Coverage, analyzers []model.AnalyzerResult) bool
- func GateNote(res *model.ScanResult, decision *policy.Decision) string
- func LimitationsNote(res *model.ScanResult) string
- func Sanitize(s string) string
- func SanitizeBlock(s string) string
- func WriteWarnings(w io.Writer, res *model.ScanResult)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzerGaps ¶
func AnalyzerGaps(analyzers []model.AnalyzerResult) []string
AnalyzerGaps returns deduplicated gaps for completed or partial analyzers. Failed, skipped, and unavailable analyzers are omitted; their status conveys the missing analysis instead.
func ContributionNote ¶
func ContributionNote(res *model.ScanResult) string
ContributionNote summarizes how many of the analyzers listed for this scan actually completed and so contributed to the verdict, out of the total
func CoverageIsMerged ¶
CoverageIsMerged reports counters that cannot describe one population. Scan-level coverage takes maxima from analyzers, so its fields may summarize different underlying sets.
func CoverageOverstatesCapabilities ¶
func CoverageOverstatesCapabilities(c model.Coverage, analyzers []model.AnalyzerResult) bool
CoverageOverstatesCapabilities detects a merged summary that credits more analysis than at least one analyzer performed. This catches plausible-looking arithmetic that still hides an individual analyzer's gap.
func GateNote ¶
func GateNote(res *model.ScanResult, decision *policy.Decision) string
GateNote explains an UNSAFE verdict's exit code, or an incomplete scan that policy allowed to pass. An incomplete scan that fails the gate needs no extra note.
func LimitationsNote ¶
func LimitationsNote(res *model.ScanResult) string
LimitationsNote names the analyzers behind this verdict that have declared limitations, so a clean verdict comes with a pointer to what it does not cover instead of standing on its own. `mcp-scanner analyzers` already prints the full Describe().Limitations text for every analyzer; this reads the same source and names which of them apply here, without repeating their content into every report.
func Sanitize ¶
Sanitize escapes control, bidi, zero-width, separator, tag, and backslash characters before untrusted text reaches terminals or delimited formats. SanitizeBlock is the multiline variant.
func SanitizeBlock ¶
SanitizeBlock preserves literal newline bytes but escapes every other unsafe rune. Unicode line and paragraph separators receive no exception because they can alter rendered structure.
func WriteWarnings ¶
func WriteWarnings(w io.Writer, res *model.ScanResult)
WriteWarnings prints res.Warnings directly under the verdict line, not at the end of the summary: every warning Aggregate builds - a best-effort scan with no required analyzer behind it, a non-fatal analyzer error, an invalid finding - exists to qualify what the verdict above it is standing on
Types ¶
This section is empty.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package json writes sanitized ScanResult values using the versioned schema.
|
Package json writes sanitized ScanResult values using the versioned schema. |
|
Package sarif writes a model.ScanResult as SARIF 2.1.0 (https://docs.oasis-open.org/sarif/sarif/v2.1.0/), the format GitHub code scanning and most CI security dashboards consume
|
Package sarif writes a model.ScanResult as SARIF 2.1.0 (https://docs.oasis-open.org/sarif/sarif/v2.1.0/), the format GitHub code scanning and most CI security dashboards consume |
|
Package summary writes a condensed, human-readable overview of a model.ScanResult: verdict, finding counts, coverage gaps and the most severe findings - not the full table internal/report/table produces
|
Package summary writes a condensed, human-readable overview of a model.ScanResult: verdict, finding counts, coverage gaps and the most severe findings - not the full table internal/report/table produces |
|
Package table writes a model.ScanResult as a plain-text table for a terminal
|
Package table writes a model.ScanResult as a plain-text table for a terminal |