KogenCredo.Check.Refactor.DuplicateHelper (KogenCredo v0.1.0)
View SourceBasics
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
The same private function pasted into several modules should live in one module and be called from the others. Duplicates drift apart and every copy needs the same fix.
Check-Specific Parameters
Use the following parameters to configure this check:
:included_paths
Only files under these path prefixes are considered.
This parameter defaults to ["lib/"].
:excluded_paths
Files under these path prefixes are skipped.
This parameter defaults to [].
:min_files
Report when this many different files hold the same helper.
This parameter defaults to 3.
:min_nodes
Minimum AST size of a helper to be considered.
This parameter defaults to 12.
:ignored_names
Helper names never reported.
This parameter defaults to [].
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.