Show HN: Treepeat – Code similarity detection using Tree-sitter
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
Show HN: Treepeat – Code similarity detection using Tree-sitter
Unofficial Hacker News client; not affiliated with Y Combinator.
[deleted] · · focus · HN ↗
[deleted]
bradleyy · · focus · HN ↗
91awebsi · · focus · HN ↗
For active projects I setup a weekly-ish 'code audit' agent: it runs treepeat to find opportunities to refactor and bumps up enforced coverage numbers. Over time for some projects I lower the '--similarity' threshold to more broadly find similar structured code (potentially more ambitious refactoring)
ryuuseijin · · focus · HN ↗
I ended up writing my own tool [1] that uses vector search, which works but can be unusably slow in large codebases.
I will give this a shot.
[1]: <a href="https://github.com/ninjaxtools/slopdex" rel="nofollow">https://github.com/ninjaxtools/slopdex
91awebsi · · focus · HN ↗
I was fortunate to have a contributor push me to consider optimizations a few months back, and it definitely helped improve the speed/memory metrics.
I see the CLI knobs are somewhat similar ('min lines', 'thresholds'), however your 'search' is fascinating. I could see myself wondering "how much error handling is duplicated for HTTP responses?" and your tool would give me a start at an answer. Nice!
Game_Ender · · focus · HN ↗
anaqin · · focus · HN ↗
91awebsi · · focus · HN ↗
adityamishra241 · · focus · HN ↗