Sha256: 7f5afdf65b137d0d9b5ee4c03d789b47127bc452fa28190099963d195e671f15

Contents?: true

Size: 893 Bytes

Versions: 53

Compression:

Stored size: 893 Bytes

Contents

# Long Parameter List

## Introduction

A _Long Parameter List_ occurs when a method has a lot of parameters.

## Example

Given

```Ruby
class Dummy
  def long_list(foo,bar,baz,fling,flung)
    puts foo,bar,baz,fling,flung
  end
end
```

Reek would report the following warning:

```
test.rb -- 1 warning:
  [2]:Dummy#long_list has 5 parameters (LongParameterList)
```

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

## Current Support in Reek

_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

53 entries across 51 versions & 2 rubygems

Version Path
reek-4.8.2 docs/Long-Parameter-List.md
reek-4.8.1 docs/Long-Parameter-List.md
reek-4.8.0 docs/Long-Parameter-List.md
reek-4.7.3 docs/Long-Parameter-List.md
reek-4.7.2 docs/Long-Parameter-List.md
reek-4.7.1 docs/Long-Parameter-List.md
reek-4.7.0 docs/Long-Parameter-List.md
reek-4.6.2 docs/Long-Parameter-List.md
reek-4.6.1 docs/Long-Parameter-List.md
reek-4.6.0 docs/Long-Parameter-List.md
reek-4.5.6 docs/Long-Parameter-List.md
reek-4.5.5 docs/Long-Parameter-List.md
reek-4.5.4 docs/Long-Parameter-List.md
reek-4.5.3 docs/Long-Parameter-List.md
reek-4.5.2 docs/Long-Parameter-List.md
reek-4.5.1 docs/Long-Parameter-List.md
reek-4.5.0 docs/Long-Parameter-List.md
reek-4.4.2 docs/Long-Parameter-List.md
reek-4.4.1 docs/Long-Parameter-List.md
reek-4.4.0 docs/Long-Parameter-List.md