Documentation
¶
Index ¶
- func ProjectNameFromPath(absPath string) string
- type ChangeCoupling
- type ChangedFile
- type ChangedHunk
- type CommitFiles
- type DiffScope
- type EnvBinding
- type FunctionRegistry
- func (r *FunctionRegistry) Exists(qualifiedName string) bool
- func (r *FunctionRegistry) FindByName(name string) []string
- func (r *FunctionRegistry) FindEndingWith(suffix string) []string
- func (r *FunctionRegistry) FuzzyResolve(calleeName, moduleQN string, importMap map[string]string) (ResolutionResult, bool)
- func (r *FunctionRegistry) LabelOf(qualifiedName string) string
- func (r *FunctionRegistry) Register(name, qualifiedName, nodeLabel string)
- func (r *FunctionRegistry) Resolve(calleeName, moduleQN string, importMap map[string]string) ResolutionResult
- func (r *FunctionRegistry) Size() int
- type Pipeline
- type ResolutionResult
- type ReturnTypeMap
- type TypeMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProjectNameFromPath ¶ added in v0.3.0
ProjectNameFromPath derives a unique project name from an absolute path by replacing path separators with dashes and trimming the leading dash.
Types ¶
type ChangeCoupling ¶ added in v0.1.3
type ChangeCoupling struct {
FileA string
FileB string
CoChangeCount int
TotalChangesA int
TotalChangesB int
CouplingScore float64
}
ChangeCoupling represents a pair of files that change together.
type ChangedFile ¶ added in v0.3.1
type ChangedFile struct {
Status string // M, A, D, R (modified, added, deleted, renamed)
Path string
OldPath string // non-empty only for renames
}
ChangedFile represents a file with a status from git diff --name-status.
func ParseGitDiffFiles ¶ added in v0.3.1
func ParseGitDiffFiles(repoPath string, scope DiffScope, baseBranch string) ([]ChangedFile, error)
ParseGitDiffFiles runs git diff --name-status and returns changed files.
func ParseNameStatusOutput ¶ added in v0.3.1
func ParseNameStatusOutput(output string) []ChangedFile
ParseNameStatusOutput parses the raw output of git diff --name-status.
type ChangedHunk ¶ added in v0.3.1
ChangedHunk represents a changed region within a file.
func ParseGitDiffHunks ¶ added in v0.3.1
func ParseGitDiffHunks(repoPath string, scope DiffScope, baseBranch string) ([]ChangedHunk, error)
ParseGitDiffHunks runs git diff --unified=0 and extracts changed line ranges.
func ParseHunksOutput ¶ added in v0.3.1
func ParseHunksOutput(output string) []ChangedHunk
ParseHunksOutput parses the raw output of git diff --unified=0.
type CommitFiles ¶ added in v0.1.3
CommitFiles holds the files changed in a single commit.
type EnvBinding ¶ added in v0.1.0
EnvBinding represents an extracted environment variable with a URL value.
func ScanProjectEnvURLs ¶ added in v0.1.0
func ScanProjectEnvURLs(rootPath string) []EnvBinding
ScanProjectEnvURLs walks the project root, scanning all non-ignored files for env var assignments where the value looks like a URL.
type FunctionRegistry ¶
type FunctionRegistry struct {
// contains filtered or unexported fields
}
FunctionRegistry indexes all Function, Method, and Class nodes by qualified name and simple name for fast call resolution.
func NewFunctionRegistry ¶
func NewFunctionRegistry() *FunctionRegistry
NewFunctionRegistry creates an empty registry.
func (*FunctionRegistry) Exists ¶ added in v0.1.4
func (r *FunctionRegistry) Exists(qualifiedName string) bool
Exists returns true if a qualified name is registered. Uses RLock for concurrent read safety.
func (*FunctionRegistry) FindByName ¶
func (r *FunctionRegistry) FindByName(name string) []string
FindByName returns all qualified names with the given simple name.
func (*FunctionRegistry) FindEndingWith ¶
func (r *FunctionRegistry) FindEndingWith(suffix string) []string
FindEndingWith returns all qualified names ending with ".suffix".
func (*FunctionRegistry) FuzzyResolve ¶ added in v0.1.3
func (r *FunctionRegistry) FuzzyResolve(calleeName, moduleQN string, importMap map[string]string) (ResolutionResult, bool)
FuzzyResolve attempts a loose match when Resolve() returns "". It searches for any registered function whose simple name matches the callee's last name segment. Returns the best match (by import distance) with confidence, or an empty result and false if no match is found.
Unlike Resolve(), this does not require prefix/import agreement — it purely matches on the function name.
func (*FunctionRegistry) LabelOf ¶ added in v0.2.0
func (r *FunctionRegistry) LabelOf(qualifiedName string) string
LabelOf returns the node label for a qualified name, or "" if not registered.
func (*FunctionRegistry) Register ¶
func (r *FunctionRegistry) Register(name, qualifiedName, nodeLabel string)
Register adds a node to the registry.
func (*FunctionRegistry) Resolve ¶
func (r *FunctionRegistry) Resolve(calleeName, moduleQN string, importMap map[string]string) ResolutionResult
Resolve attempts to find the qualified name of a callee using a prioritized resolution strategy:
- Import map lookup
- Same-module match
- Project-wide single match by simple name
- Suffix match with import distance scoring
func (*FunctionRegistry) Size ¶
func (r *FunctionRegistry) Size() int
Size returns the number of entries in the registry.
type Pipeline ¶
type Pipeline struct {
Store *store.Store
RepoPath string
ProjectName string
// contains filtered or unexported fields
}
Pipeline orchestrates the 3-pass indexing of a repository.
type ResolutionResult ¶ added in v0.3.3
type ResolutionResult struct {
QualifiedName string
Strategy string // "import_map", "import_map_suffix", "same_module", "unique_name", "suffix_match", "fuzzy", "type_dispatch"
Confidence float64 // 0.0–1.0
CandidateCount int // how many candidates were considered
}
ResolutionResult carries the resolved QN plus quality metadata. Initial confidence values are estimates — recalibrate after measuring precision per strategy on real repos.
type ReturnTypeMap ¶ added in v0.3.3
ReturnTypeMap maps function QN → return type QN (class/struct the function returns).
Source Files
¶
- communities.go
- configures.go
- decorates.go
- docstrings.go
- enrichment.go
- envscan.go
- gitdiff.go
- githistory.go
- implements.go
- imports.go
- infrascan.go
- infrascan_tf.go
- infrascan_yaml.go
- inherits.go
- pipeline.go
- readwrite.go
- resolve.go
- resolver.go
- testdetect.go
- tests.go
- throws.go
- typeinfer.go
- typeinfer_dynamic.go
- typeinfer_typed.go
- usages.go
- usestype.go