kevinrutherford / reek
- Source
- Commits
- Network (8)
- Issues (33)
- Downloads (37)
- Wiki (29)
- Graphs
-
Tree:
5dcd8e4
commit 5dcd8e461ec507d88a48fdb7f1e9e8fa6eac3ed1
tree 9abc1087e3d3dd08176a86be97b0ef57ed2d2f1c
parent 99b08be1818e41dc4d36bc4fe474370ae7ffbb26
tree 9abc1087e3d3dd08176a86be97b0ef57ed2d2f1c
parent 99b08be1818e41dc4d36bc4fe474370ae7ffbb26
reek /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Sep 20 12:51:40 -0700 2009 | |
| |
History.txt | ||
| |
License.txt | Thu Jul 09 12:53:06 -0700 2009 | |
| |
Manifest.txt | ||
| |
README.rdoc | Mon Sep 21 13:25:29 -0700 2009 | |
| |
Rakefile | Mon Oct 12 06:47:36 -0700 2009 | |
| |
bin/ | Fri Jul 24 12:34:30 -0700 2009 | |
| |
config/ | ||
| |
features/ | ||
| |
lib/ | ||
| |
quality/ | ||
| |
reek.gemspec | ||
| |
spec/ | ||
| |
tasks/ | ||
| |
website/ |
README.rdoc
Reek — code smell detection 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 a full list of command-line options see the Reek wiki 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 the following smells:
- Control Couple
- Data Clump
- Feature Envy
- Large Class
- Long Method
- Long Parameter List
- Simulated Polymorphism
- Uncommunicative Name
…and more. See the Reek wiki 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::RakeTask 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 1.9.1
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:
- Browse the Reek documentation at wiki.github.com/kevinrutherford/reek
- Browse the code or install the latest cutting-edge beta version from github.com/kevinrutherford/reek/tree
- Read the code API at rdoc.info/projects/kevinrutherford/reek

