I built codesweep, a duplicate-code detector in Rust — looking for feedback

Hey Rust community

I’ve been working on codesweep, a CLI built with Rust and Tree-sitter that finds duplicate and structurally similar functions.

I built this tool because I write code in Swift and JavaScript (JS), and I couldn't find duplicate code.

It compares syntax structure, so differences in formatting, comments, or function names don’t hide duplicated logic. It currently supports TypeScript, JavaScript, Dart/Flutter, Kotlin, Swift, Go, and C#, with binaries for macOS, Linux, and Windows.

Example:

codesweep ./src --language typescript --threshold 80

I’d love feedback on detection accuracy, false positives, and the CLI experience. If you try it on a real project, I’d be especially interested in cases where the results are surprising or unhelpful.

The linked repo contains downloads and usage documentation:
codesweep on GitHub

Thanks for taking a look.

Does it work by the algorithm described in Finding duplicated code with tools from your CS course | purplesyringa's blog?

No, that’s not exactly the algorithm. codesweep extracts the code structure using Tree-sitter and performs comparisons after normalization.
it also uses the Dice coefficient to determine similarity.
The method described in the paper ignores local variable name changes based on their scope, whereas CodeSweep does not currently do this.