hauleth

hauleth

Mix unused - simple task for looking for unused public functions

After request in this thread I created simple task for looking for unused public functions (mix xref unreachable returns information only about unused private functions).

Code: GitHub - hauleth/mix_unused: Find unused functions in your project · GitHub

Currently it isn’t released on Hex as I am still polishing the edges. Feel free to test this out.

Most Liked

hauleth

hauleth

So I have finally find some time to make it work for Elixir 1.10 and publish it on Hex.

Now it is implemented via compiler tracing, so it is only Elixir 1.10 and later, but thanks to that, it also works with ElixirLS.

Beware that it is still WIP, and there are some features missing, and it will print a lot (and by a lot I mean A LOT) of false positives as it do not filter out generated functions nor Elixir macros. So prepare for filtering out quite a lot.

Testers, suggestions, and pull requests are welcome.

What is not currently working:

  • Macros filtering
  • Generated functions filtering (so for example you need to filter out {:_, :__schema__, :_} if you use Ecto, all controller actions if you use Phoenix, etc.)
  • Lines for given functions, so all missing functions will be reported on top of the file
  • No way to filter out functions using regular expression
  • No way to filter out functions using range arity
12
Post #3
hauleth

hauleth

v0.4.1 released

The main reason for that is that older version was reporting false positives (used function reported as unused) if there was a call cycle.

Bug Fixes

  • resolve issue with unused analyzer reporting false positives (3b86630)

Documentation

  • Improve Usage Docs a bit around usage (a191c46)
10
Post #7
hauleth

hauleth

Release v0.2.0

Added few useful features:

  • macros are supported now
  • you can filter out functions and modules using regular expressions
  • you can filter arity using ranges
  • lines are properly supported, which mean that ElixirLS will report unused functions as a lens in correct places

Where Next?

Popular in Announcing Top

mathieuprog
Hello :waving_hand: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First a...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
gabrielpoca
Hello everyone! I want to share with you something that I’m really proud of: https://stillstatic.io/ Still is a static site builder for...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10483 141
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement