lib/rubocop/cop/metrics/block_nesting.rb in rubocop-0.88.0 vs lib/rubocop/cop/metrics/block_nesting.rb in rubocop-0.89.0
- old
+ new
@@ -9,18 +9,18 @@
# You can configure if blocks are considered using the `CountBlocks`
# option. When set to `false` (the default) blocks are not counted
# towards the nesting level. Set to `true` to count blocks as well.
#
# The maximum level of nesting allowed is configurable.
- class BlockNesting < Cop
+ class BlockNesting < Base
include ConfigurableMax
NESTING_BLOCKS = %i[
case if while while_post
until until_post for resbody
].freeze
- def investigate(processed_source)
+ def on_new_investigation
return if processed_source.blank?
max = cop_config['Max']
check_nesting_level(processed_source.ast, max, 0)
end