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.