Documentation
¶
Index ¶
- Constants
- type Config
- type CriticalIssue
- type Format
- type JSONCriticalIssue
- type JSONReport
- type JSONRiskArea
- type Reporter
- func (r *Reporter) AddResults(results []models.AnalysisResult)
- func (r *Reporter) ClearProgress()
- func (r *Reporter) Generate() error
- func (r *Reporter) HasProgress() bool
- func (r *Reporter) SetDependencyCounts(direct, transitive int)
- func (r *Reporter) SetManifestCount(count int)
- func (r *Reporter) SetScanPath(path string)
- func (r *Reporter) ShowProgress(current, total int, packageName string)
- type ScanStats
Constants ¶
const ( ColorReset = colorReset ColorRed = "\033[31m" ColorYellow = colorYellow ColorGreen = colorGreen ColorCyan = colorCyan ColorBold = colorBold ColorDim = colorDim )
Exported color codes for use by format-specific files.
const ( BoxTopLeft = "┌" BoxTopRight = "┐" BoxBottomLeft = "└" BoxBottomRight = "┘" BoxHorizontal = "─" BoxVertical = "│" BoxTeeLeft = "├" BoxTeeRight = "┤" )
Box drawing characters
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Format Format
Verbose bool
Writer io.Writer
ShowProgress bool
ProgressWriter io.Writer // Where to write progress output; defaults to Writer if nil
}
Config holds configuration for report generation
type CriticalIssue ¶
type CriticalIssue struct {
PackageName string
PackageVersion string
Ecosystem string
RiskLevel string
Description string
Evidence string
Severity string
SourceURL string
}
CriticalIssue represents a critical finding with package details
type JSONCriticalIssue ¶
type JSONCriticalIssue struct {
PackageName string `json:"package_name"`
PackageVersion string `json:"package_version"`
Ecosystem string `json:"ecosystem"`
RiskLevel string `json:"risk_level"`
Severity string `json:"severity"`
Description string `json:"description"`
Evidence string `json:"evidence,omitempty"`
SourceURL string `json:"source_url,omitempty"`
}
JSONCriticalIssue represents a critical issue in JSON format
type JSONReport ¶
type JSONReport struct {
Metadata struct {
GeneratedAt string `json:"generated_at"`
ScanPath string `json:"scan_path"`
ManifestFiles int `json:"manifest_files"`
} `json:"metadata"`
Summary struct {
TotalPackages int `json:"total_packages"`
DirectDependencies int `json:"direct_dependencies"`
TransitiveDependencies int `json:"transitive_dependencies"`
HighRisk int `json:"high_risk"`
MediumRisk int `json:"medium_risk"`
LowRisk int `json:"low_risk"`
OverallRisk string `json:"overall_risk"`
ScanDuration float64 `json:"scan_duration_seconds"`
} `json:"summary"`
ExecutiveSummary struct {
KeyFindings []JSONCriticalIssue `json:"key_findings"`
Summary string `json:"summary"`
} `json:"executive_summary"`
Results interface{} `json:"results"`
KeyRiskAreas []JSONRiskArea `json:"key_risk_areas"`
}
JSONReport represents the JSON output structure
type JSONRiskArea ¶ added in v1.9.0
type JSONRiskArea struct {
Tag string `json:"tag"`
Summary string `json:"summary"`
Explanation string `json:"explanation"`
Examples []string `json:"examples,omitempty"`
}
JSONRiskArea represents a risk area in JSON format
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter handles report generation
func (*Reporter) AddResults ¶
func (r *Reporter) AddResults(results []models.AnalysisResult)
AddResults adds analysis results to the report
func (*Reporter) ClearProgress ¶
func (r *Reporter) ClearProgress()
ClearProgress clears the progress line
func (*Reporter) HasProgress ¶ added in v1.6.0
HasProgress returns true if the reporter is configured to show progress bars
func (*Reporter) SetDependencyCounts ¶ added in v1.8.1
SetDependencyCounts sets the direct and transitive dependency counts. These reflect the total found before any filtering is applied.
func (*Reporter) SetManifestCount ¶
SetManifestCount sets the number of manifest files found
func (*Reporter) SetScanPath ¶
SetScanPath sets the path that was scanned
func (*Reporter) ShowProgress ¶
ShowProgress displays an enhanced progress indicator with time info and animations
type ScanStats ¶
type ScanStats struct {
StartTime time.Time
EndTime time.Time
TotalPackages int
HighRisk int
MediumRisk int
LowRisk int
ManifestFiles int
ScannedPath string
DirectDeps int // Number of direct dependencies found (before filtering)
TransitiveDeps int // Number of transitive dependencies found (before filtering)
}
ScanStats contains scan statistics