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.3.0 docs/Control-Parameter.md
reek-4.2.5 docs/Control-Parameter.md
reek-4.2.4 docs/Control-Parameter.md
reek-4.2.3 docs/Control-Parameter.md
reek-4.2.2 docs/Control-Parameter.md
reek-4.2.1 docs/Control-Parameter.md
reek-4.2.0 docs/Control-Parameter.md
reek-4.1.1 docs/Control-Parameter.md
reek-4.1.0 docs/Control-Parameter.md
reek-4.0.5 docs/Control-Parameter.md
reek-4.0.4 docs/Control-Parameter.md