Every repository with this icon (
Every repository with this icon (
Home
Welcome to the home of Reek, the code smell detector for Ruby!
Reek is a tool that examines Ruby classes, modules and methods and reports any Code Smells it finds. Install it like this:
gem install reek
and run it like this:
reek [options] [dir_or_source_file]*
For more information see Command-Line Options or run
reek --help
Example
Imagine a source file csv_writer.rb containing:
class CsvWriter
def write_line(fields)
if (fields.length == 0)
puts
else
write_field(fields[0])
1.upto(fields.length-1) do |i|
print ","
write_field(fields[i])
end
puts
end
end
#...
end
Reek will report the following code smells in this file:
$ reek csv_writer.rb CsvWriter#write_line calls fields.length multiple times (Duplication) CsvWriter#write_line has approx 6 statements (Long Method) CsvWriter#write_line/block has the variable name 'i' (Uncommunicative Name)
Features
Reek currently includes checks for some aspects of Control Couple, Data Clump, Feature Envy, Large Class, Long Method, Long Parameter List, Simulated Polymorphism, Uncommunicative Name and more. See the Code Smells for up to date details of exactly what Reek will check in your code.
Tool Integration
Reek integrates with many of your favourite tools:
- Use Reek’s Rake Task to easily add Reek to your Rakefile
- Use Reek::Spec to add the should_not reek custom matcher to your Rspec examples
- Reek is fully compliant with Ruby 1.8.6, 1.8.7 and Ruby 1.9
Dependencies
Reek makes use of the following other gems:
- ruby_parser
- sexp_processor
- ruby2ruby
Learn More
Find out more about Reek from any of the following sources:
- Getting Started on this wiki
- the Reek Mailing List
- Stack Overflow
I want to …
- download the Reek gem => Installation
- learn how to use Reek => Getting Started
- browse the RDoc => http://rdoc.info/projects/kevinrutherford/reek
or…
- browse the source code => http://github.com/kevinrutherford/reek
- clone the latest source code => git://github.com/kevinrutherford/reek.git
or…
- review Reek => https://www.ohloh.net/p/reek
- request a feature => github
- report a defect => github
- contact the author => http://github.com/kevinrutherford






