Code Dependencies
The mix tool is smart when it compiles your project. It analyzes the dependencies between your source files, and only recompiles a file when it has changed or a file it depends on has changed. As a developer, you can also access this dependency information, gaining valuable insights into your code. You do this with the mix xref commands.
- mix xref unreachable
-
List functions that are unknown at the time they are called.
- mix xref warnings
-
List warnings associated with dependencies (for example, calls to unknown functions).
- mix xref callers Mod | Mod.func | Mod.func/arity
-
List the callers to a module or function:
$ mix xref callers Logger mix xref callers Logger web/controllers/page_controller.ex:1: Logger.bare_log/3 web/controllers/page_controller.ex:1: ...
Get Programming Elixir ≥ 1.6 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.