Sha256: 9db580e2428b8534a11d2b3121ae0a88c96569ea01480400046d014ca087c978

Contents?: true

Size: 931 Bytes

Versions: 17

Compression:

Stored size: 931 Bytes

Contents

# Long Yield List

## Introduction

A _Long Yield List_ occurs when a method yields a lot of arguments to the block it gets passed.

## Example

```Ruby
class Dummy
  def yields_a_lot(foo,bar,baz,fling,flung)
    yield foo,bar,baz,fling,flung
  end
end
```

Reek would report the following warning:

```
test.rb -- 1 warning:
  [4]:Dummy#yields_a_lot yields 5 parameters (LongYieldList)
```

A common solution to this problem would be the introduction of parameter objects.

## Current Support in Reek

Currently Long Parameter List reports any method or block with more than 3 parameters.

## Configuration

Reek's Long Parameter List detector supports the [Basic Smell Options](Basic-Smell-Options.md), plus:

| Option         | Value       | Effect  |
| ---------------|-------------|---------|
| max_params |  integer | The maximum number of parameters allowed in a method or block before a warning is issued. Defaults to 3. |

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
reek-4.0.1 docs/Long-Yield-List.md
reek-4.0.0 docs/Long-Yield-List.md
reek-4.0.0.pre1 docs/Long-Yield-List.md
reek-3.11 docs/Long-Yield-List.md
reek-3.10.2 docs/Long-Yield-List.md
reek-3.10.1 docs/Long-Yield-List.md
reek-3.10.0 docs/Long-Yield-List.md
reek-3.9.1 docs/Long-Yield-List.md
reek-3.9.0 docs/Long-Yield-List.md
reek-3.8.3 docs/Long-Yield-List.md
reek-3.8.2 docs/Long-Yield-List.md
reek-3.8.1 docs/Long-Yield-List.md
reek-3.8.0 docs/Long-Yield-List.md
reek-3.7.1 docs/Long-Yield-List.md
reek-3.7.0 docs/Long-Yield-List.md
reek-3.6.1 docs/Long-Yield-List.md
reek-3.6.0 docs/Long-Yield-List.md