View Source Credo.Check.Readability.NestedFunctionCalls (Credo v1.7.4)


This check is disabled by default.

Learn how to enable it via .credo.exs.

This check is tagged :controversial

This means that this check is more opinionated than others and not for everyone's taste.

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


A function call should not be nested inside another function call.

So while this is fine:


The code in this example ...


... should be refactored to look like this:

|> Enum.uniq()
|> Enum.shuffle()

Nested function calls make the code harder to read. Instead, break the function calls out into a pipeline.

Like all Readability issues, this one is not a technical concern. But you can improve the odds of others reading and liking your code by making it easier to follow.

Check-Specific Parameters

Use the following parameters to configure this check:


Set a minimum pipeline length

This parameter defaults to 2.

General Parameters

Like with all checks, general params can be applied.

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