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-6.0.3 docs/Control-Parameter.md
reek-6.0.2 docs/Control-Parameter.md
reek-6.0.1 docs/Control-Parameter.md
reek-6.0.0 docs/Control-Parameter.md
reek-5.6.0 docs/Control-Parameter.md
reek-5.5.0 docs/Control-Parameter.md
reek-5.4.1 docs/Control-Parameter.md
reek-5.4.0 docs/Control-Parameter.md
reek-5.3.2 docs/Control-Parameter.md
reek-5.3.1 docs/Control-Parameter.md
reek-5.3.0 docs/Control-Parameter.md
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Control-Parameter.md
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Control-Parameter.md
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Control-Parameter.md
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/Control-Parameter.md
reek-5.2.0 docs/Control-Parameter.md
reek-5.1.0 docs/Control-Parameter.md
reek-5.0.2 docs/Control-Parameter.md
reek-5.0.1 docs/Control-Parameter.md
reek-5.0.0 docs/Control-Parameter.md