@kongyo2/similarity-ts
github.com
Spec sheet
- Purpose
- The project describes itself as a TypeScript-only similarity analyzer for detecting semantic code similarities.Read 7 Oct 2026 · github.com
- License
- The repository identifies its license as MIT.Read 7 Oct 2026 · github.com
- Accuracy benchmark
- The README reports that version 0.7.0 correctly labeled all 300 pairs in its stated benchmark corpus.Read 7 Oct 2026 · github.com
- Analysis modes
- Its default modes are functions, types, classes, and overlap, and the README documents options to select modes and restrict scan scope.Read 5 Oct 2026 · github.com
- Analysis targets
- It compares functions, types, and classes structurally.Read 7 Oct 2026 · github.com
- Behavioral distinctions
- The README says behavior-changing differences such as `.map` versus `.filter` and `async` versus synchronous contracts retain distinct shapes.Read 7 Oct 2026 · github.com
- CI use
- The CLI offers a `--fail-on-duplicates` option that exits non-zero when any pair is reported.Read 7 Oct 2026 · github.com
- CLI controls
- The CLI supports selecting analysis modes, setting a similarity threshold, filtering file extensions, excluding patterns, and choosing pretty or JSON output.Read 7 Oct 2026 · github.com
- Code style matching
- It canonicalizes documented style variants, including arrow functions versus declarations, `.then()` versus `await`, and several loop forms.Read 5 Oct 2026 · github.com
- Exclusions
- A declaration can be excluded from the report with a `// similarity-ignore` comment on the preceding line.Read 5 Oct 2026 · github.com
- Install and run
- The README’s quick start runs the analyzer with `npx @kongyo2/similarity-ts .`.Read 5 Oct 2026 · github.com
- Intended workflow
- The README suggests using the command with an AI coding assistant to find duplicate code patterns and create a refactoring plan.Read 7 Oct 2026 · github.com
- Maker identity
- The repository is hosted under the GitHub account `kongyo2`; the opened project pages do not state a maker’s personal or company name, headquarters, or founding date.Read 5 Oct 2026 · github.com
- Output and CI
- It supports pretty or JSON output and a `--fail-on-duplicates` option that exits nonzero when any pair is reported.Read 5 Oct 2026 · github.com
- Package form and runtime
- The package metadata describes a CLI and library, exposes a command-line binary and JavaScript entry point, and specifies Node.js 20 or newer.Read 5 Oct 2026 · github.com
- Package formats
- The package metadata exposes both a `similarity-ts` command-line executable and a JavaScript library entry point with TypeScript declarations.Read 7 Oct 2026 · github.com
- Rename handling
- It alpha-renames function parameters, locals, inner functions, and declaration names before comparison, while retaining free identifier names.Read 7 Oct 2026 · github.com
- Runtime requirement
- The package metadata specifies Node.js version 20 or newer.Read 7 Oct 2026 · github.com
- Style normalization
- The analyzer canonicalizes several equivalent coding forms, including function declarations and arrow functions, some loop rewrites, and structurally identical interfaces and type aliases.Read 7 Oct 2026 · github.com
- Supported file extensions
- The default extensions it scans are `ts`, `tsx`, `mts`, and `cts`.Read 5 Oct 2026 · github.com
- Threshold and size controls
- The similarity threshold defaults to 0.8, the minimum function length defaults to three lines, and a minimum AST-token size can replace the line gate.Read 5 Oct 2026 · github.com
- Usage
- The README shows running it on the current directory with `npx @kongyo2/similarity-ts .`.Read 7 Oct 2026 · github.com
Where Specifiction places it
- Code Clone Detection Tools#19 of 236.9