{"repo":"elixir-vibe/ex_dna","free":true,"listed":false,"github":"https://github.com/elixir-vibe/ex_dna","clone":"git clone https://github.com/elixir-vibe/ex_dna.git","description":"Code duplication detector powered by Elixir AST analysis","language":"Elixir","stars":115,"topics":["ast","clone-detection","code-duplication","credo","elixir","refactoring","static-analysis"],"license":"MIT","category":"dev-tools","readme_excerpt":"ExDNA 🧬 Code duplication detector for Elixir, inspired by jscpd but built on Elixir's native AST instead of token matching. Because ExDNA understands code structure — not just text — fn(a, b) - a + b end and fn(x, y) - x + y end are recognized as the same code. It also tells you how to fix each clone: extract a function, a macro, or a behaviour callback. Features - Three clone types — exact copies (I), renamed variables / changed literals (II), and near-miss clones via structural similarity (III) - Multi-clause awareness — consecutive def / defp clauses with the same name/arity are analyzed as a single unit, catching duplicated pattern-matching functions that individual clauses are too small to flag - Delegation pattern detection — def foo(x), do: foo(x, []) followed by def foo(x, opts) are grouped as one unit, catching duplicated wrapper+body pairs across modules - Sibling window detection — adjacent functions copied between modules are caught even when the surrounding code differs - Refactoring suggestions — extract function, extract macro, extract behaviour with @callback - Smart naming — suggestions are named after the dominant struct, call, or pattern ( build changeset , contact step ) instead of extracted function - Pipe normalization — x f() and f(x) match as the same code - Field order normalization — %User{name: x, age: y} and %User{age: y, name: x} match in Type-II mode - Guard normalization — when is binary(x) and when is atom(x) match in Type-II mode (covers Kern","default_branch":null,"files":null,"tree":[],"storefront":"/r/elixir-vibe","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/elixir-vibe/ex_dna/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}