View Source Credo.Check.Refactor.Apply (Credo v1.7.0)
This check has a base priority of low
and works with any version of Elixir.
explanation
Explanation
Prefer calling functions directly if the number of arguments is known
at compile time instead of using apply/2
and apply/3
.
Example:
# preferred
fun.(arg_1, arg_2, ..., arg_n)
module.function(arg_1, arg_2, ..., arg_n)
# NOT preferred
apply(fun, [arg_1, arg_2, ..., arg_n])
apply(module, :function, [arg_1, arg_2, ..., arg_n])
check-specific-parameters
Check-Specific Parameters
There are no specific parameters for this check.
general-parameters
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs
config file.