lib/reek/ast/sexp_extensions/if.rb in reek-4.7.3 vs lib/reek/ast/sexp_extensions/if.rb in reek-4.8.0
- old
+ new
@@ -7,11 +7,18 @@
module IfNode
def condition
children.first
end
+ # :reek:FeatureEnvy
def body_nodes(type, ignoring = [])
- children[1..-1].compact.flat_map { |child| child.find_nodes(type, ignoring) }
+ children[1..-1].compact.flat_map do |child|
+ if ignoring.include? child.type
+ []
+ else
+ child.each_node(type, ignoring).to_a
+ end
+ end
end
end
end
end
end