Sha256: 05fca54b235a05461e520f9ff3bf91439de2b61e643ac695b69633bc95f93628

Contents?: true

Size: 987 Bytes

Versions: 53

Compression:

Stored size: 987 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. It is a special case of [Long Parameter List](Long-Parameter-List.md).

## 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 Yield List_ reports any method or block with more than 3 parameters.

## Configuration

Reek's _Long Yield 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

53 entries across 51 versions & 2 rubygems

Version Path
reek-6.0.3 docs/Long-Yield-List.md
reek-6.0.2 docs/Long-Yield-List.md
reek-6.0.1 docs/Long-Yield-List.md
reek-6.0.0 docs/Long-Yield-List.md
reek-5.6.0 docs/Long-Yield-List.md
reek-5.5.0 docs/Long-Yield-List.md
reek-5.4.1 docs/Long-Yield-List.md
reek-5.4.0 docs/Long-Yield-List.md
reek-5.3.2 docs/Long-Yield-List.md
reek-5.3.1 docs/Long-Yield-List.md
reek-5.3.0 docs/Long-Yield-List.md
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Long-Yield-List.md
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Long-Yield-List.md
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Long-Yield-List.md
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Long-Yield-List.md
reek-5.2.0 docs/Long-Yield-List.md
reek-5.1.0 docs/Long-Yield-List.md
reek-5.0.2 docs/Long-Yield-List.md
reek-5.0.1 docs/Long-Yield-List.md
reek-5.0.0 docs/Long-Yield-List.md