Documentation
¶
Overview ¶
Package finding defines shared structured analyzer output types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateSeverity ¶
ValidateSeverity accepts the three stable severities exposed by audit tools.
Types ¶
type AuditResult ¶
type AuditResult struct {
Findings []Finding `json:"findings"`
Total int `json:"total"`
Truncated bool `json:"truncated"`
CountsBySeverity map[Severity]int `json:"counts_by_severity"`
FilesScanned int `json:"files_scanned"`
DurationMS int64 `json:"duration_ms"`
}
AuditResult is the bounded, aggregate result of an analyzer run.
func Filter ¶
func Filter(result AuditResult, minimum Severity, limit int) AuditResult
Filter returns findings at or above min and clamps the visible findings to max. Total and CountsBySeverity describe the severity-filtered set before truncation.
type Finding ¶
type Finding struct {
Rule string `json:"rule"`
RuleName string `json:"rule_name,omitempty"`
Severity Severity `json:"severity"`
Location Location `json:"location"`
Message string `json:"message"`
Suggestion string `json:"suggestion,omitempty"`
}
Finding is one source-located analyzer diagnostic.
type Location ¶
type Location struct {
File string `json:"file"`
Line int `json:"line"`
Col int `json:"col,omitempty"`
}
Location is a slash-separated source position relative to the workspace.
Click to show internal directories.
Click to hide internal directories.