Shared Go module that provides language-agnostic code analysis algorithms for pyscn (Python analyzer) and jscan (JavaScript/TypeScript analyzer).
| Package | Description |
|---|---|
apted/ |
APTED tree edit distance algorithm with configurable cost models and normalization |
cfg/ |
Control Flow Graph data structures, reachability analysis, McCabe cyclomatic complexity, dead code detection |
clone/ |
AST feature extraction and 5 clone grouping strategies (Connected, KCore, StarMedoid, CompleteLinkage, Centroid) |
graph/ |
Directed graph abstraction, Tarjan SCC cycle detection, Robert Martin coupling metrics |
lsh/ |
Locality-Sensitive Hashing index and MinHash signatures |
util/ |
Common utilities (browser opener) |
go get github.com/ludo-technologies/[email protected]
Language-specific behavior is injected via interfaces and callbacks:
graph.DirectedGraph— pyscn'smap[string]*ModuleNodeand jscan'sdomain.DependencyGraphboth implement thiscfg.StatementClassifier— abstracts return/break/continue/throw detection across languagescfg.ComplexityContributor— allows language-specific complexity additions (e.g. jscan's logical operators)graph.CouplingConfig.AbstractnessFunc— injects language-specific abstractness calculationclone.GroupingStrategy[T]— generic grouping with Go 1.24 generics for type-safe usageapted.CostModel— language-specific tree edit cost models (PythonCostModel, JavaScriptCostModel stay in each project)
Go 1.24+
MIT