Duplex allows you to search for similar code blocks inside your Elixir project.
Remotely (without repository cloning)
mix escript.install https://raw.githubusercontent.com/zirkonit/duplex/master/duplex
Locally
mix do escript.build, escript.install
cd /path/to/project
~/.mix/escripts/duplex
- Add
:duplexto deps inmix.exs
defdepsdo[{:duplex,"~> 0.1.1"}]end- Update dependencies
mix deps.get
iex-SmixDuplex.show_similarYou can change default values on config.exs by adding next lines with your own values
config:duplex,threshold: 7# filter AST nodes with `node.length + node.depth >= threshold`# Than lower threshold, than simpler nodes will be included.# Optimal value is around 7-10. Default is 7.config:duplex,dirs: ["lib","config","web"]# directories to search for Elixir source filesconfig:duplex,n_jobs: 4# number of threads