Sha256: 575c7d036c8791d5c98cb531019a16262f2c6c82290b8c84a292ed399f698333

Contents?: true

Size: 902 Bytes

Versions: 17

Compression:

Stored size: 902 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

17 entries across 17 versions & 1 rubygems

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