marcoow / excellent forked from simplabs/excellent

Source Code analysis gem for Ruby and Rails

This URL has Read+Write access

marcoow (author)
Mon May 25 08:46:27 -0700 2009
commit  eef63c473c2a132ed88426cbdc8e704a4c282193
tree    9355b8bad796458c095e5412828808b567011351
parent  bd5dadea38aabfb8315f2ab837ffac303359c2b2
name age message
file .gitignore Wed May 06 08:48:55 -0700 2009 v1.0.0 [marcoow]
file History.txt Loading commit data...
file MIT-LICENSE Wed May 20 06:34:07 -0700 2009 added documentation; renamed Error to Warning [marcoow]
file README.rdoc
file Rakefile
file VERSION.yml
directory bin/
file excellent.gemspec
directory lib/
directory spec/
README.rdoc

Excellent

Excellent detects commonly regarded bad code snippets like empty rescue blocks etc. It combines roodi (github.com/martinjandrews/roodi), most checks of reek (github.com/kevinrutherford/reek), flog (github.com/seattlerb/flog) and also adds some Rails specific checks.

See the API documentation at docs.github.com/simplabs/excellent and the WIKI at wiki.github.com/simplabs/excellent.

Installation

Simply install with Ruby Gems:

  gem sources -a http://gems.github.com
  sudo gem install simplabs-excellent

Example

To analyse all the models in your Rails application, just do

  excellent app/models

in your RAILS_ROOT. You can also invoke analysation through the Simplabs::Excellent::Runner class. Excellent can also produce HTML output. To get a formatted HTML report, just specify html:<filename>:

  excellent html:out.html app/models

Static analysis

A few words regarding static code analysis: Static code analysis tools like Excellent can never really understand the code. They just search for patterns that might inidicate problematic code. The word might really has to be stressed here since static analysis will usually return a reasonable number of false positives. For example, there might be pretty good reasons for empty rescue blocks that suppress all errors (Excellent itself does it). So, don’t try and code with the aim of passing Excellent with zero warnings. That will most likely make your code a mess. Instead use Excellent as a helper to find possibly problematic code early.

Contribute

If you want to contribute, just fork the repo. Also I would appretiate suggestions for more checks (especially Rails specific checks) - simply open a new issue: github.com/simplabs/excellent/issues.

Author

Copyright © 2008-2009 Marco Otte-Witte (simplabs.com), released under the MIT license.

Excellent was inspired by and is in parts based on roodi (github.com/martinjandrews/roodi), reek (github.com/kevinrutherford/reek) and flog (github.com/seattlerb/flog).