simstruct

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i simstruct

Weekly Downloads

0

Version

0.1.0

License

none

Unpacked Size

71.8 kB

Total Files

28

Last publish

Collaborators

  • jens-ox