You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class RepeatedConditionals
def repeat_1
switch = true # or some other code, e.g. `Service.call(...)`
puts "Repeat 1!" if switch
end
def repeat_2
switch = false # or some other code, e.g. `Service.call(...)`
puts "Repeat 2!" if switch
end
def repeat_3
switch = 123 # or some other code, e.g. `Service.call(...)`
puts "Repeat 3!" if switch
end
end
reek incorrectly reports Repeated Conditional
It shouldn't do this if all of the conditionals are local variables.
The text was updated successfully, but these errors were encountered:
@troessner I'd like to help on this one. I wonder how should we fix it. Can we scope the if and case per def method? will it break the attr_accessor scenario? Thanks for any help/guide/idea you can provide.
In case we have code like
reek incorrectly reports Repeated Conditional
It shouldn't do this if all of the conditionals are local variables.
The text was updated successfully, but these errors were encountered: