Fl4m3Ph03n1x
Background
Recently I found out aboubt mix xref, which according to my understanding analyses the code for unreachable paths and deprecated functions.
Questions
It looks really nice, but I have some questions:
- Isn’t this already part of the
mix compiletask that runs automatically every time you execute a non-compiled project? - In which scenarios do I have to manually run this command?
- Do you guys use it in your CIs ?
Please let me know your answers !
Trending in Discussions
Hey folks,
I wanted to share with you a project I’ve been working on for a while: It’s an Open Source (AGPLv3) newsletter tool. Think Ma...
New
Hi there! :wave:
@frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
In my third year of college, around 2010, I found Erlang. A few years later, I found Elixir. I liked the ideas at once: many small proces...
New
Hi everyone,
I have 8 years of production experience with Erlang/OTP and I’m just starting to get to know Elixir. What would you learn f...
New
A note on form. Joe Armstrong, co-creator of the Erlang programming language, died in April 2019. What follows is a work of narrative non...
New
I’ve been tinkering with Lynx (by José) via hold_ledger. I used AI to write the code, a separate specification, the tests, and the Lean p...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hauleth
mix xrefwas useful not only for finding unreachable code, it also supported looking for all callers or generating dependency graph of the application. So none of these functionalities was available during compilation.Fl4m3Ph03n1x
But do you use it on a daily basis?
NobbZ
Do you use
mix test --stale? If yes, you are usingmix xrefmore than you might know that you use it.Similar if you use the ElixirLS. It builds upon
xrefs result asas well.hauleth
Do you use
dbgmodule on daily basis? Do you usemix profile.*on daily basis? No, these tools have specific use cases, and when you need them you praise all J’s that decided that it should be part of the default release instead of spending X hours on searching solutions that will work.webuhu
I was using
mix xrefwithin CI.In detail:
mix xref unreachable --abort-if-anymix xref deprecated --abort-if-anyBut as with Elixir v1.10 these checks will move into the compiler.
I will use instead:
mix compile --warnings-as-errorsdimitarvp
I’m currently using
mix xref callers MyApp.Schema– a module namespace that contains all my DB (Ecto) code. I’m integrating it in a GIT pre-commit hook that checks which modules use that namespace because I only want certain modules to directly use DB code.So that’s one valid usage: you can enforce some limitations on your project at GIT pre-commit or CI server level. You can call it homemade linting.
Another very good usage is refactoring. When you move functions around – or rename them, or delete them – you want to minimise compilation or runtime errors so you first search who calls them and rework those as well along the way.
lawik
Saw the command thanks to the coming changes and ended up needing
mix xref callers MyModule.function/1to refactor things in a client project.