reek
TLDR
Check Ruby code for smells
$ reek [file.rb]
Check entire project$ reek
Check with specific format$ reek --format [yaml] [file.rb]
Show available smell types$ reek --smell-types
Exclude specific smells$ reek --except [TooManyStatements] [file.rb]
SYNOPSIS
reek [options] [files...]
DESCRIPTION
Reek is a code smell detector for Ruby. It analyzes Ruby code and reports potential design problems like long methods, feature envy, and data clumps.
PARAMETERS
-f, --format format
Output format (text, yaml, json, html).--smell-types
List available smells.--except smells
Exclude smells.--only smells
Check only specified smells.-c, --config file
Configuration file.
EXAMPLES
$ # Check file
reek app/models/user.rb
# Check directory
reek app/
# JSON output
reek --format json app/ > smells.json
# List smell types
reek --smell-types
# Specific smells only
reek --only "TooManyStatements,LongMethod" app/
# With configuration
reek -c .reek.yml
reek app/models/user.rb
# Check directory
reek app/
# JSON output
reek --format json app/ > smells.json
# List smell types
reek --smell-types
# Specific smells only
reek --only "TooManyStatements,LongMethod" app/
# With configuration
reek -c .reek.yml
SMELL TYPES
$ TooManyStatements - Method too long
FeatureEnvy - Wrong class responsibility
DataClump - Data always together
LongParameterList - Too many parameters
DuplicateMethodCall - Repeated calls
FeatureEnvy - Wrong class responsibility
DataClump - Data always together
LongParameterList - Too many parameters
DuplicateMethodCall - Repeated calls
CONFIGURATION (.reek.yml)
$ detectors:
TooManyStatements:
max_statements: 10
exclude_paths:
- spec/
TooManyStatements:
max_statements: 10
exclude_paths:
- spec/
CAVEATS
Ruby-specific. Some smells may be false positives. Configure per project.
HISTORY
Reek was created by Kevin Rutherford as a Ruby code smell detector based on Martin Fowler's refactoring concepts.


