Skip to content
kevinclark edited this page Sep 13, 2010 · 1 revision

Branches (BranchDuster)

  • Warns on useless branches
          if 1 == 2
    true
    else
    false
    end
  • Warns on identical branches
          if true
    1 + 2
    else
    1 + 2
    end
  • Warns on branches with an assignment as a condition
          if a = 1
    1
    else
    2
    end

Blocks (BlockDuster)

  • Warns if yield is called, but there isn’t a check for block_given?

Exceptions (RescueDuster)

  • Warns if there is a rescue to a value
    do_some_call rescue 42
  • Warns if there is a rescue for Object or Exception

Arguments (ArgumentDuster)

  • Warns on unused arguments
  • Warns on unused local variables
  • Warns when shadowing local variables with block arguments

    x = 1
    some_block_yielding_method do |x|
    x = 4
    end

Methods (MethodDuster)

  • Warns on empty methods

end