Documentation
¶
Overview ¶
Package shared provides common utilities for analyzer implementations. This package is separate from the main analyzer package to avoid import cycles when subdirectory packages need these utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTestFileByPath ¶
IsTestFileByPath checks if a file path indicates a Python test file. Used by C6 testing analyzer.
func NodeText ¶
func NodeText(node *tree_sitter.Node, content []byte) string
NodeText extracts the text content of a Tree-sitter node.
func TsIsTestFile ¶
TsIsTestFile checks if a TypeScript file path indicates a test file. Used by C6 testing analyzer.
func TsStripQuotes ¶
TsStripQuotes removes surrounding quotes from a string literal. Used by C6 testing analyzer.
func WalkTree ¶
func WalkTree(node *tree_sitter.Node, fn func(*tree_sitter.Node))
WalkTree walks a Tree-sitter tree depth-first, calling fn for each node.
Types ¶
type ImportGraph ¶
type ImportGraph struct {
Forward map[string][]string // package -> packages it imports (efferent)
Reverse map[string][]string // package -> packages that import it (afferent)
}
ImportGraph holds forward and reverse adjacency lists for intra-module imports.
func BuildImportGraph ¶
func BuildImportGraph(pkgs []*parser.ParsedPackage, modulePath string) *ImportGraph
BuildImportGraph constructs an import graph from parsed packages, filtering to only intra-module imports (those with the given module path prefix).