Documentation
¶
Overview ¶
Package deadcode detects functions and methods with zero incoming calls.
Index ¶
Constants ¶
View Source
const ( ConfidenceHigh = "high" ConfidenceMedium = "medium" ConfidenceLow = "low" )
Confidence levels for dead code classification.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeadSymbol ¶
type DeadSymbol struct {
Name string `json:"name"`
Kind string `json:"kind"`
File string `json:"file"`
Package string `json:"package"`
StartLine int `json:"start_line"`
Lines int `json:"lines"`
Exported bool `json:"exported"`
Confidence string `json:"confidence"` // high, medium, low
}
DeadSymbol is a function/method with zero incoming calls.
type Options ¶
type Options struct {
IncludeExported bool // include exported (public) symbols — usually false positives
IncludeTests bool // include test-file symbols
HookCallbacks []string // function names registered as WordPress hook callbacks
Relationships []parser.TypeRelationship // type relationships for interface-aware filtering
// OxCodes is an optional ox-codes client. When set, a second pass searches
// for string references to apparent dead symbols, reducing false positives
// caused by callbacks, reflection, and config-driven dispatch.
OxCodes *oxcodes.Client
Root string // repo root path (required for ox-codes queries)
Language string // primary language (for scoped search)
// Ctx is used for cancellation when OxCodes is set. A nil Ctx means
// context.Background() is used.
Ctx context.Context //nolint:containedctx
}
Options configures dead code detection.
Click to show internal directories.
Click to hide internal directories.