class RuboCop::Cop::Style::For

def incorrect_style_detected(method)

def incorrect_style_detected(method)
  end_pos = method.source_range.end_pos
  range = range_between(end_pos - EACH_LENGTH, end_pos)
  add_offense(range, range, 'Prefer `for` over `each`.') do
    opposite_style_detected
  end
end