Parent

Methods

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Lint::UnreachableCode

This cop checks for unreachable code. The check are based on the presence of flow of control statement in non-final position in begin(implicit) blocks.

Public Instance Methods

on_begin(node) click to toggle source
# File lib/rubocop/cop/lint/unreachable_code.rb, line 14
def on_begin(node)
  expressions = *node

  expressions.each_cons(2) do |e1, e2|
    next unless NODE_TYPES.include?(e1.type) || flow_command?(e1)
    add_offense(e2, :expression)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.