Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRepositoryFilter ¶
func ApplyRepositoryFilter(repo github.RepositoryInfo, filter RepositoryFilter) bool
ApplyRepositoryFilter checks if a repository matches the filter criteria
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer handles organization-wide analysis
func NewAnalyzer ¶
func NewAnalyzer(client *github.Client, cfg *config.Config, maxWorkers int, showProgress bool) *Analyzer
NewAnalyzer creates a new organization analyzer
func (*Analyzer) AnalyzeOrganization ¶
func (a *Analyzer) AnalyzeOrganization(ctx context.Context, orgName string, filter RepositoryFilter) (*OrganizationResult, error)
AnalyzeOrganization performs security analysis on all repositories in an organization
type OrganizationResult ¶
type OrganizationResult struct {
Organization string `json:"organization"`
ScanTime time.Time `json:"scan_time"`
Duration time.Duration `json:"duration"`
TotalRepositories int `json:"total_repositories"`
AnalyzedRepositories int `json:"analyzed_repositories"`
SkippedRepositories int `json:"skipped_repositories"`
RepositoryResults []RepositoryResult `json:"repository_results"`
Summary OrganizationSummary `json:"summary"`
}
OrganizationResult represents the analysis result for an entire organization
func (*OrganizationResult) RecalculateSummary ¶
func (r *OrganizationResult) RecalculateSummary()
RecalculateSummary recomputes the aggregated summary and repository counts from the current RepositoryResults. Call this after findings have been mutated in place (for example, by AI verification) so the summary reflects those changes. The summary is fully derived from the results and the calculation helpers hold no Analyzer state, so a zero-value Analyzer is safe.
type OrganizationSummary ¶
type OrganizationSummary struct {
TotalFindings int `json:"total_findings"`
FindingsBySeverity map[string]int `json:"findings_by_severity"`
FindingsByCategory map[string]int `json:"findings_by_category"`
RepositoriesByRisk map[string]int `json:"repositories_by_risk"`
TopFindings []TopFinding `json:"top_findings"`
RiskDistribution []RepositoryRiskInfo `json:"risk_distribution"`
}
OrganizationSummary provides aggregated statistics for an organization
type RepositoryFilter ¶
type RepositoryFilter = github.RepositoryFilter
RepositoryFilter is now defined in the github package
type RepositoryResult ¶
type RepositoryResult struct {
Repository github.RepositoryInfo `json:"repository"`
Findings []rules.Finding `json:"findings"`
WorkflowsCount int `json:"workflows_count"`
RulesCount int `json:"rules_count"`
Duration time.Duration `json:"duration"`
Error error `json:"error,omitempty"`
}
RepositoryResult represents the analysis result for a single repository
type RepositoryRiskInfo ¶
type RepositoryRiskInfo struct {
Repository github.RepositoryInfo `json:"repository"`
RiskLevel string `json:"risk_level"` // LOW, MEDIUM, HIGH, CRITICAL
FindingsCount int `json:"findings_count"`
CriticalCount int `json:"critical_count"`
HighCount int `json:"high_count"`
Score float64 `json:"score"` // Risk score 0-100
}
RepositoryRiskInfo provides risk assessment for individual repositories