KogenCredo.Check.Refactor.SizeLimits (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

Split instead of growing. A module past a few hundred lines has more than one reason to change; a function past forty lines hides branches. Extract smaller functions or modules.

Check-Specific Parameters

Use the following parameters to configure this check:

:max_file_lines

Maximum lines per file.

This parameter defaults to 400.

:max_module_lines

Maximum lines per module.

This parameter defaults to 400.

:max_function_lines

Maximum lines per function clause.

This parameter defaults to 40.

:count_blank_and_comment_lines

When false only lines with code are counted.

This parameter defaults to true.

:count_template_lines

When true the body of heredoc ~H templates counts toward function length.

This parameter defaults to false.

: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 [].

General Parameters

Like with all checks, general params can be applied.

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