Skip to content

Instantly share code, notes, and snippets.

@filipechagas
filipechagas / bad.rb
Created February 19, 2016 14:01
Cyclomatic Complexity - Guard clause overused
def compute_thing(thing)
if thing[:foo]
update_with_bar(thing)
if thing[:foo][:bar]
partial_compute(thing)
else
re_compute(thing)
end
end
end