lib/rubocop/cop/metrics/block_nesting.rb in rubocop-0.35.1 vs lib/rubocop/cop/metrics/block_nesting.rb in rubocop-0.36.0
- old
+ new
@@ -1,6 +1,7 @@
# encoding: utf-8
+# frozen_string_literal: true
module RuboCop
module Cop
module Metrics
# This cop checks for excessive nesting of conditional and looping
@@ -13,10 +14,10 @@
include IfNode
NESTING_BLOCKS = [
:case, :if, :while, :while_post,
:until, :until_post, :for, :resbody
- ]
+ ].freeze
def investigate(processed_source)
return unless processed_source.ast
max = cop_config['Max']
check_nesting_level(processed_source.ast, max, 0)