‹ BackHN Continuity

Thread

Show HN: Treepeat – Code similarity detection using Tree-sitter

73 points · 8 comments · 91awebsi

  1. ryuuseijin · · focus · HN ↗
    This is what I wanted to help with duplicate code detection, which is now a real problem with agentic programming since the agent tends to duplicate helper functions a lot in bigger codebases.

    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:&#x2F;&#x2F;github.com&#x2F;ninjaxtools&#x2F;slopdex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ninjaxtools&#x2F;slopdex

    1. 91awebsi · · focus · HN ↗
      ooh I&#x27;ll give yours a shot - thanks for calling my project out on your readme!

      I was fortunate to have a contributor push me to consider optimizations a few months back, and it definitely helped improve the speed&#x2F;memory metrics.

      I see the CLI knobs are somewhat similar (&#x27;min lines&#x27;, &#x27;thresholds&#x27;), however your &#x27;search&#x27; is fascinating. I could see myself wondering &quot;how much error handling is duplicated for HTTP responses?&quot; and your tool would give me a start at an answer. Nice!

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.