Sha256: 6bb256a68028c26784f476d67a22163e4dba33c59ba311d5a7316837fa0ba790

Contents?: true

Size: 784 Bytes

Versions: 17

Compression:

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

17 entries across 17 versions & 1 rubygems

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