# `LexCredo.Check.Warning.NoPipeIntoCase`
[🔗](https://github.com/sippy-platform/lex_credo/blob/main/lib/lex_credo/check/warning/no_pipe_into_case.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

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

## Explanation

Do not pipe into `case` expressions.

Assign intermediate results to a variable and pass it to `case` directly.
Piping into `case` is hard to read and can obscure the subject of the match.

    # BAD
    build_post(attrs)
    |> store_post()
    |> case do
      {:ok, post} -> post
      {:error, _} -> nil
    end

    # GOOD
    changeset = build_post(attrs)
    case store_post(changeset) do
      {:ok, post} -> post
      {:error, _} -> nil
    end

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:exclude_test_files`

  When `true`, skips test files. Default: `false`.

*This parameter defaults to* `false`.

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
