Avoid
if
branches without a body. 1if 1 > 2 and 2 < 3 2end 3
4(1..100) === 7
5
Description
Presence of if
, elsif
and unless
branches without a body can be removed.
Bad practice
if condition
end
unless condition
end
if condition
do_something
elsif other_condition
end
Recommended
if condition
do_something
end
unless condition
do_something
end
if condition
do_something
elsif other_condition
do_something_else
end