amacgregor
Is there any tooling or recommended way to find dead code?
Is there any tooling or recommended way to find dead code? As my application starts to grow things can get a little messy especially with autogenerated contexts in phoenix.
GitHub - hauleth/mix_unused: Find unused functions in your project is kinda what I was looking for but it seems is no longer working nor maintained.
Thanks in advance! 
Most Liked
hauleth
I am (very) slowly working on that one to work with compiler tracer. I can push my branch (I thought it is pushed) where I am trying to implement such and if you have any PR then it will be more than welcome.
Marcus
The compiler gives you a warning for unreachable functions. That means private functions which are not called in the module where these are defined are throwing such warnings. But public functions that are never called anywhere are not checked by the compiler.
axelson
It doesn’t look like your mix unused project you referred to here was ever posted to this thread. Here’s a link to the project:
binarytemple
The problem with these approaches is that quite a lot of dynamic invocation (:erlang.apply/3) happens in Erlang/Elixir projects and dialyser/xref and friends can’t be aware of what’s being invoked when the call site is dynamic.
hauleth
This will return a lot of false positives due to macros and other autogenerated functions in Elixir.







