Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyResult ¶
ApplyResult captures the outcome of applying a plan.
type BlockedCandidate ¶
type BlockedCandidate struct {
File string `json:"file"`
Line int `json:"line"`
Rule string `json:"rule"`
Kind string `json:"kind"`
Name string `json:"name"`
Reason string `json:"reason"`
}
BlockedCandidate is a dead-code finding that is intentionally not removed.
type Candidate ¶
type Candidate struct {
File string `json:"file"`
Line int `json:"line"`
Rule string `json:"rule"`
Kind string `json:"kind"`
Name string `json:"name"`
}
Candidate is a directly removable dead-code finding.
type Plan ¶
type Plan struct {
Candidates []Candidate `json:"candidates"`
Blocked []BlockedCandidate `json:"blockedCandidates"`
// contains filtered or unexported fields
}
Plan separates directly removable dead code from findings that still need additional safety work before bulk deletion can use them.
func BuildPlanColumns ¶
func BuildPlanColumns(columns *scanner.FindingColumns) Plan
BuildPlanColumns classifies columnar dead-code findings into immediately removable entries and blocked entries without reconstructing all rows.
func (Plan) Apply ¶
func (p Plan) Apply(suffix string) ApplyResult
Apply runs the plan through the shared fix engine.
type ProjectFinding ¶
type ProjectFinding struct {
File string `json:"file"`
Line int `json:"line"`
Kind string `json:"kind"`
Name string `json:"name"`
FQN string `json:"fqn"`
Visibility string `json:"visibility"`
Reason string `json:"reason"`
Module string `json:"module,omitempty"`
}
ProjectFinding describes a declaration unreachable from project roots.
func AnalyzeProject ¶
func AnalyzeProject(scanRoot string, opts ProjectOptions) ([]ProjectFinding, error)
AnalyzeProject performs project-level reachability dead-code analysis. It discovers Gradle modules at scanRoot (best effort), parses Kotlin and Java files under opts.Paths, identifies reachability roots, and reports any non-private declarations not reachable from those roots.
type ProjectOptions ¶
type ProjectOptions struct {
// Roots are user-supplied additional reachability roots, identified by
// FQN or simple name.
Roots []string
// Workers controls parser parallelism. Defaults to runtime.NumCPU().
Workers int
// Paths restricts scanning to these directories. Defaults to ScanRoot.
Paths []string
}
ProjectOptions configures project-level dead-code analysis.
type ReasonCount ¶
ReasonCount is a deterministic count bucket for blocked reasons.