Skip to content

Files

Latest commit

 

History

History
40 lines (29 loc) · 554 Bytes

Lint-UnreachableCode.md

File metadata and controls

40 lines (29 loc) · 554 Bytes

Pattern: Unreachable code

Issue: -

Description

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

Examples

# bad

def some_method
  return
  do_something
end

# bad

def some_method
  if cond
    return
  else
    return
  end
  do_something
end
# good

def some_method
  do_something
end

Further Reading