Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Language-agnostic core algorithms for code analysis (APTED, LSH, CFG, clone detection)

License

Notifications You must be signed in to change notification settings

ludo-technologies/codescan-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

codescan-core

Shared Go module that provides language-agnostic code analysis algorithms for pyscn (Python analyzer) and jscan (JavaScript/TypeScript analyzer).

Packages

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)

Install

go get github.com/ludo-technologies/[email protected]

Design

Language-specific behavior is injected via interfaces and callbacks:

  • graph.DirectedGraph — pyscn's map[string]*ModuleNode and jscan's domain.DependencyGraph both implement this
  • cfg.StatementClassifier — abstracts return/break/continue/throw detection across languages
  • cfg.ComplexityContributor — allows language-specific complexity additions (e.g. jscan's logical operators)
  • graph.CouplingConfig.AbstractnessFunc — injects language-specific abstractness calculation
  • clone.GroupingStrategy[T] — generic grouping with Go 1.24 generics for type-safe usage
  • apted.CostModel — language-specific tree edit cost models (PythonCostModel, JavaScriptCostModel stay in each project)

Requirements

Go 1.24+

License

MIT

About

Language-agnostic core algorithms for code analysis (APTED, LSH, CFG, clone detection)

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages