KogenCredo.Check.Warning.VariableModuleCall (KogenCredo v0.1.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of low and works with any version of Elixir.

Explanation

mod.fun() on a variable hides the callee from xref, Boundary and capability analysis. Use a behaviour whose implementation is picked at compile time (module attribute), or dispatch with an explicit case over the known modules.

Check-Specific Parameters

Use the following parameters to configure this check:

:included_paths

Only files under these path prefixes are checked.

This parameter defaults to ["lib/"].

:excluded_paths

Files under these path prefixes are skipped.

This parameter defaults to [].

:allowed_variables

Variable names that may hold a module (e.g. [:adapter]).

This parameter defaults to [].

:ignored_functions

Function names never reported.

This parameter defaults to [:module_info, :__info__, :__struct__, :behaviour_info].

:check_apply

Also report apply(variable, fun, args).

This parameter defaults to true.

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.