simstruct
v0.1.0
Published
`npx simstruct`
Downloads
8
Readme
simstruct
npx simstruct
Find similarities in JS(X)/TS(X) codebases based on structural similarity.
Motivation
Other tools like jscpd
use the Rabin-Karp algorithm to detect code duplications, which only works with identical copies.
simstruct
uses the AST generated by SWC to find identical structures within your codebase.
Usage
In your project's root directory, run
npx simstruct
This will create a .simstruct
directory that includes reports on code duplication.
Outlook
This is a first release. The following fundamental things are missing:
- add tests
- add a configurable minimum snippet length to not detect every single ternary operation as a duplicate
- add a configurable minimum Levenshtein distance for strings to enable filtering of unrelated code