Sha256: c8c374338f88b66f2dc4897bd72ee159b9dd751e14202de7d25b77afbff43a5d

Contents?: true

Size: 786 Bytes

Versions: 15

Compression:

Stored size: 786 Bytes

Contents

# Control Parameter

## Introduction

`Control Parameter` is a special 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 alltogether and to move the calls to "write_quoted" / "write_unquoted" in the initial caller of "write".

## Current Support in reek

`reek` warns about control coupling when a method parameter or block parameter is the tested value in a conditional statement.

## Configuration

Control Couple supports the [Basic Smell Options](Basic-Smell-Options.md).

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
reek-3.5.0 docs/Control-Parameter.md
reek-3.4.1 docs/Control-Parameter.md
reek-3.4.0 docs/Control-Parameter.md
reek-3.3.1 docs/Control-Parameter.md
reek-3.3.0 docs/Control-Parameter.md
reek-3.2.1 docs/Control-Parameter.md
reek-3.2 docs/Control-Parameter.md
reek-3.1 docs/Control-Parameter.md
reek-3.0.4 docs/Control-Parameter.md
reek-3.0.3 docs/Control-Parameter.md
reek-3.0.2 docs/Control-Parameter.md
reek-3.0.1 docs/Control-Parameter.md
reek-3.0.0 docs/Control-Parameter.md
reek-2.2.1 docs/Control-Parameter.md
reek-2.2.0 docs/Control-Parameter.md