lib/rubocop/cop/metrics/block_nesting.rb in rubocop-0.25.0 vs lib/rubocop/cop/metrics/block_nesting.rb in rubocop-0.26.0
- old
+ new
@@ -37,12 +37,12 @@
ignore_node(node)
end
end
end
end
- node.children.each do |child|
- next unless child.is_a?(Parser::AST::Node)
- check_nesting_level(child, max, current_level)
+
+ node.each_child_node do |child_node|
+ check_nesting_level(child_node, max, current_level)
end
end
def message(max)
"Avoid more than #{max} levels of block nesting."