Sha256: 608f5082f2bcfe579737391fbeb28958e686dc5bf351e23f369b2b6efa47f9cd

Contents?: true

Size: 778 Bytes

Versions: 51

Compression:

Stored size: 778 Bytes

Contents

# Control Parameter

## Introduction

_Control Parameter_ is a case of [Control Couple](Control-Couple.md).

## Example

A simple example would be the `quoted` parameter in the following method:

```Ruby
def write(quoted)
  if quoted
    write_quoted @value
  else
    write_unquoted @value
  end
end
```

Fixing those problems is out of the scope of this document but an easy solution
could be to remove the `write` method altogether and to move the calls to
`write_quoted` and `write_unquoted` to the caller of `write`.

## Current Support in Reek

Reek warns about _Control Parameter_ when a method parameter or block parameter is
the tested value in a conditional statement.

## Configuration

_Control Parameter_ supports the [Basic Smell Options](Basic-Smell-Options.md).

Version data entries

51 entries across 49 versions & 2 rubygems

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