Ruby

Ruby

Made by DeepSource

Multiple methods with same name in the same scope RB-LI1013

Bug risk
Major

Each method in a scope should have a unique name. Having multiple methods with the same name is usually a result of typos.

Bad practice

def f
  puts "Hello"
end

def f
  puts "World"
end

def g
  puts "!"
end

alias f g

Recommended

def f
  puts "Hello"
end

def g
  puts "World"
end

def h
  puts "!"
end

alias i h