Git Product home page Git Product logo

rubycritic's Introduction

RubyCritic

Gem Version Build Status Code Climate

RubyCritic Icon

RubyCritic is a gem that wraps around static analysis gems such as [Reek][1], [Flay][2] and [Flog][3] 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

Getting Started

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

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

$ rubycritic --help
Command flag Description
-v/--version Displays the current version and exits
-p/--path Sets the output directory (tmp/rubycritic by default)
-m/--mode-ci Uses CI mode (faster, but only analyses last commit)

Alternative Usage Methods

If you're fond of Guard you might like guard-rubycritic. It automatically analyses your Ruby files as they are modified.

For continuous integration, you can give Jenkins CI a spin. With it, you can easily build your own (poor-man's) Code Climate!

Improving RubyCritic

RubyCritic doesn't have to remain a second choice to other code quality analysis services. Together, we can improve it and continue to build on the great code metric tools that are available in the Ruby ecosystem.

Arguably, the better_errors gem only got popular after receiving a (pretty awesome) Pull Request that changed its page design.

Similarly, Pull Requests that improve the look and feel of the gem, that tweak the calculation of ratings or that fix existing issues will be most welcome. This is my first gem, so just commenting on an issue and giving some insight into how something should work will be appreciated. No contribution is too small.

See RubyCritic's contributing guidelines about how to proceed.

Credits

Whitesmith

RubyCritic is maintained and funded by Whitesmith. Tweet your questions or suggestions to @glitchdout or @Whitesmithco.

rubycritic's People

Contributors

guilhermesimoes avatar boza avatar tamaloa avatar malfafar avatar

Watchers

James Cloos 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.