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

martinjandrews / roodi

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 98
    • 7
  • Source
  • Commits
  • Network (7)
  • Issues (2)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
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.

Ruby Object Oriented Design Inferometer — Read more

  cancel

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

This URL has Read+Write access

Added MissingForeignKeyIndexCheck. Comment
Marty Andrews (author)
Sun Dec 27 21:36:08 -0800 2009
commit  2892d4ca5b056dbb44a1fb5a67333c24fb0b7330
tree    b8bd96e9b9d8fff388faba35c51004a43fb044f6
parent  14a0ea589413ad5f832aac7dfd63e0328de31706
roodi /
name age
history
message
file .gitignore Wed Feb 18 15:04:49 -0800 2009 Prepare for a release that includes bug fixes f... [martinjandrews]
file History.txt Sun Oct 25 17:17:00 -0700 2009 update version number and history [martinjandrews]
file Manifest.txt Sun Aug 23 04:13:16 -0700 2009 removed dependency on facets. preparing for rel... [martinjandrews]
file README.txt Wed May 06 21:09:31 -0700 2009 Cleaned up naming after moving to ruby_parser. [martinjandrews]
file Rakefile Sun Aug 23 04:13:16 -0700 2009 removed dependency on facets. preparing for rel... [martinjandrews]
directory bin/ Wed May 06 21:09:31 -0700 2009 Cleaned up naming after moving to ruby_parser. [martinjandrews]
directory lib/ Sun Dec 27 21:36:08 -0800 2009 Added MissingForeignKeyIndexCheck. [Marty Andrews]
file roodi.yml Sun Dec 27 21:36:08 -0800 2009 Added MissingForeignKeyIndexCheck. [Marty Andrews]
directory spec/ Sun Dec 27 21:36:08 -0800 2009 Added MissingForeignKeyIndexCheck. [Marty Andrews]
README.txt
= roodi

* http://roodi.rubyforge.org

== DESCRIPTION:

Roodi stands for Ruby Object Oriented Design Inferometer.  It parses your Ruby code and warns you about design issues 
you have based on the checks that is has configured.

== INSTALL:

* sudo gem install roodi

== SYNOPSIS:

To check one or more files using the default configuration that comes with Roodi, use:
    roodi [-config=file] [pattern ...]

=== EXAMPLE USAGE

Check all ruby files in a rails app:
    roodi "rails_app/**/*.rb"

Check one controller and one model file in a rails app:
    roodi app/controller/sample_controller.rb app/models/sample.rb

Check one controller and all model files in a rails app:
    roodi app/controller/sample_controller.rb "app/models/*.rb"

Check all ruby files in a rails app with a custom configuration file:
    roodi -config=my_roodi_config.yml "rails_app/**/*.rb"

If you're writing a check, it is useful to see the structure of a file the way that Roodi tokenizes it (via 
ruby_parser). Use:
    roodi-describe [filename]

== CUSTOM CONFIGURATION

To change the set of checks included, or to change the default values of the checks, you can provide your own config 
file.  The config file is a YAML file that lists the checks to be included.  Each check can optionally include a hash of 
options that are passed to the check to configure it.  For example, the default config file looks like this:

    AssignmentInConditionalCheck:    { }
    CaseMissingElseCheck:            { }
    ClassLineCountCheck:             { line_count: 300 }
    ClassNameCheck:                  { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }
    CyclomaticComplexityBlockCheck:  { complexity: 4 }
    CyclomaticComplexityMethodCheck: { complexity: 8 }
    EmptyRescueBodyCheck:            { }
    ForLoopCheck:                    { }
    MethodLineCountCheck:            { line_count: 20 }
    MethodNameCheck:                 { pattern: !ruby/regexp /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/ }
    ModuleLineCountCheck:            { line_count: 300 }
    ModuleNameCheck:                 { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }
    ParameterNumberCheck:            { parameter_count: 5 }

== SUPPORTED CHECKS:

* AssignmentInConditionalCheck - Check for an assignment inside a conditional.  It's probably a mistaken equality 
comparison.
* CaseMissingElseCheck - Check that case statements have an else statement so that all cases are covered.
* ClassLineCountCheck - Check that the number of lines in a class is below the threshold.
* ClassNameCheck - Check that class names match convention.
* CyclomaticComplexityBlockCheck - Check that the cyclomatic complexity of all blocks is below the threshold.
* CyclomaticComplexityMethodCheck - Check that the cyclomatic complexity of all methods is below the threshold.
* EmptyRescueBodyCheck - Check that there are no empty rescue blocks.
* ForLoopCheck - Check that for loops aren't used (Use Enumerable.each instead)
* MethodLineCountCheck - Check that the number of lines in a method is below the threshold.
* MethodNameCheck - Check that method names match convention.
* ModuleLineCountCheck - Check that the number of lines in a module is below the threshold.
* ModuleNameCheck - Check that module names match convention.
* ParameterNumberCheck - Check that the number of parameters on a method is below the threshold.

== SUGGESTED CHECKS:

* BlockVariableShadowCheck - Check that a block variable does not have the same name as a method parameter or local 
variable.  It may be mistakenly referenced within the block.

== LICENSE:

(The MIT License)

Copyright (c) 2008 Marty Andrews

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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