report

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package report holds what every output writer (json, sarif, table, summary) shares

Index

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

func CoverageIsMerged(c model.Coverage) bool

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

func Sanitize(s string) string

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

func SanitizeBlock(s string) string

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.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL