class RuboCop::ConfigValidator

def check_cop_config_value(hash, parent = nil)

rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
def check_cop_config_value(hash, parent = nil)
  hash.each do |key, value|
    check_cop_config_value(value, key) if value.is_a?(Hash)
    next unless CONFIG_CHECK_KEYS.include?(key) && value.is_a?(String)
    if key == 'Enabled' && !CONFIG_CHECK_DEPARTMENTS.include?(value)
      supposed_values = 'a boolean'
    elsif key == 'AutoCorrect' && !CONFIG_CHECK_AUTOCORRECTS.include?(value)
      supposed_values = '`always`, `contextual`, `disabled`, or a boolean'
    else
      next
    end
    raise ValidationError, param_error_message(parent, key, value, supposed_values)
  end
end