I was trying to find a way to get mix xref to show me the functions that my modules export when they should not be exported. Basically, what we get in Erlang with rebar3 or xref_runner if we add exports_not_used to the list of warnings (more info here).
Is there any way to specifically tell mix xref to run xref:analyze/2,3 with the parameters I want?
Just as a clarification - mix xref has nothing to do with the Erlang’s xref module. Elixir does its own analysis based on data gathered during compilation of Elixir modules. The Erlang’s xref was just too slow to run on every compilation like the Elixir’s analysis does.
Here X - XU is a query that means "Exported" minus "Exported and Used", which essentially leaves you with Exported and Unused. See these references for more advanced queries and a reference: