github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

simplabs / excellent

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 22
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (6)
  • Downloads (11)
  • Wiki (31)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (4)
    • big-refactor
    • gh-pages
    • integration
    • master ✓
  • Tags (11)
    • v1.5.5
    • v1.5.3
    • v1.5.2
    • v1.4.2
    • v1.4.0
    • v1.3.1
    • v1.3.0
    • v.1.3.0
    • v1.2.2
    • v1.2.1
    • v1.0.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Source Code analysis gem for Ruby and Rails — Read more

  cancel

http://simplabs.github.com/excellent

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

updated copyright notice 
marcoow (author)
Sat Jan 23 07:06:43 -0800 2010
commit  7e87c5268af63fdb96a3b15fa48d5e17eb40b6ab
tree    7897ff2580af80dc9d885fa1030371e1d34cc7f3
parent  798e817ce5af25331bcb21b05760e109f6acf7e8
excellent /
name age
history
message
file .gitignore Wed May 06 08:48:55 -0700 2009 v1.0.0 [marcoow]
file History.txt Wed Oct 14 13:11:23 -0700 2009 Merge branch 'integration' Conflicts: History... [marcoow]
file MIT-LICENSE Wed May 20 06:34:07 -0700 2009 added documentation; renamed Error to Warning [marcoow]
file README.rdoc Sat Jan 23 07:06:43 -0800 2010 updated copyright notice [marcoow]
file Rakefile Fri Sep 18 10:54:06 -0700 2009 added default rake task [marcoow]
file VERSION.yml Wed Oct 14 11:41:15 -0700 2009 added spec.opts to get nicer output in autospec [marcoow]
directory bin/ Wed Oct 14 12:48:07 -0700 2009 * I just like single quotes better - can't help... [marcoow]
file excellent.gemspec Wed Oct 14 11:41:15 -0700 2009 added spec.opts to get nicer output in autospec [marcoow]
directory lib/ Thu Oct 15 13:51:17 -0700 2009 if the target of a call is itself a call, don't... [marcoow]
directory spec/ Fri Jan 15 01:53:07 -0800 2010 remove old parsing specs, parsing will be refac... [marcoow]
README.rdoc

Excellent

Excellent *finds the nasty lines in your code*. It implements a comprehensive set of checks for possibly buggy parts of your app that would *otherwise make it into your repo and eventually to the production server*.

See the API documentation at docs.github.com/simplabs/excellent and the WIKI at wiki.github.com/simplabs/excellent. Join the Google Group and discuss about the future and possibilities of Excellent: groups.google.com/group/excellent-gem.

Excellent also has a CI server set up at ci.simplabs.com/excellent.

Installation

Simply install with Ruby Gems:

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

Example

Assume you have the following class definition,

  class ShoppingBasket < ActiveRecord::Base

    def initialize(items = [])
      self.items = items
    end

  end

then Excellent will report the problems in this piece of code:

  $ excellent shopping_basket.rb

    Excellent result:

    test.rb
      * Line   1: ShoppingBasket does not validate any attributes.
      * Line   1: ShoppingBasket defines initialize method.
      * Line   1: ShoppingBasket does not specify attr_accessible.

    Found 3 warnings.

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 -o out.html app/models

You can also use Excellent in a Rake task:

  require 'simplabs/excellent/rake'

  Simplabs::Excellent::Rake::ExcellentTask.new(:excellent) do |t|
    t.html  = 'doc/excellent.html' # optional, if you don't specify html, output will be written to $stdout
    t.paths = %w(app lib)
  end

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-2010 Marco Otte-Witte (simplabs.com), released under the MIT license.

Excellent was inspired by roodi (github.com/martinjandrews/roodi), reek (github.com/kevinrutherford/reek) and flog (github.com/seattlerb/flog).

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server