Sha256: 22dd8fcfdba9b200f8c1016fd2b38de00dffb2a8172cb9a419ec5f941fc56a90
Contents?: true
Size: 618 Bytes
Versions: 12
Compression:
Stored size: 618 Bytes
Contents
require 'simplabs/excellent/checks/base' module Simplabs module Excellent module Checks # This check reports empty +rescue+ blocks. Empty +rescue+ blocks suppress all errors which is usually not a good technique. # # ==== Applies to # # * +rescue+ blocks class EmptyRescueBodyCheck < Base def initialize #:nodoc: super @interesting_nodes = [:resbody] end def evaluate(context) #:nodoc: add_warning(context, 'Rescue block is empty.', {}, -1) unless context.has_statements? end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems