Git Product home page Git Product logo

rubycritic's Introduction

RubyCritic

Gem Version Build Status Code Climate

RubyCritic is a gem that wraps around static analysis gems such as Reek and Flay to provide a quality report of your Ruby code.

This gem provides features such as:

  1. An overview of your project:

RubyCritic overview screenshot

  1. An index of the project files with their respective number of smells:

RubyCritic code index screenshot

  1. An index of the smells detected:

RubyCritic smells index screenshot

  1. Finally, when analysing code like the following:
class Dirty
  def awful(x, y)
    if y
      @screen = widgets.map {|w| w.each {|key| key += 3}}
    end
  end
end

It basically turns something like this:

Reek output screenshot

Into something like this:

RubyCritic file code screenshot

Installation

RubyCritic can be installed with the following command:

$ gem install rubycritic

If you'd rather install RubyCritic using Bundler, add this line to your application's Gemfile:

gem "rubycritic", :require => false

And then execute:

$ bundle

Usage

Running rubycritic with no arguments will analyse all the Ruby files in the current directory:

$ rubycritic

Alternatively you can pass rubycritic a list of files and directories to check:

$ rubycritic app lib/foo.rb

By default, RubyCritic generates its report in tmp/rubycritic. You can customize the output directory using the path option. You can use relative paths:

rubycritic --path tmp/custom_dir        # outputs to tmp/custom_dir

Or full paths:

rubycritic --path $HOME/tmp/custom_dir  # outputs to $HOME/tmp/custom_dir

For a full list of the command-line options run:

$ rubycritic --help

rubycritic's People

Contributors

guilhermesimoes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.