Documentation
¶
Overview ¶
Package reachability decides, cheaply and conservatively, whether the code holding a finding is called from anywhere in the project.
This is not interprocedural analysis. It answers one narrow question — is the enclosing symbol referenced anywhere outside its own declaration — and answers "unknown" whenever it cannot be sure. That is enough to separate a weakness on a live path from one in a helper nobody calls any more, which is the difference between a queue people work through and a queue people mute.
Every guard here exists to avoid the expensive mistake: calling live code dead. Frameworks invoke handlers by name, exported symbols are called by other projects, and reflection is invisible to a text search. When any of those apply, the answer is "unknown".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer counts references to symbols across a project, caching the file list and the contents it reads for the duration of a scan.
func (*Analyzer) UnreachableSymbols ¶
func (a *Analyzer) UnreachableSymbols( ctx context.Context, root string, refs []ports.SymbolRef, ) mo.Result[map[string]bool]
UnreachableSymbols returns, for each symbol asked about, whether nothing in the project references it.
A symbol absent from the result map is "unknown", not "reachable": callers must treat the two differently.