class RuboCop::ConfigLoaderResolver

def resolve_inheritance(path, hash, file, debug) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize

rubocop:disable Metrics/MethodLength, Metrics/AbcSize
def resolve_inheritance(path, hash, file, debug) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
  inherited_files = Array(hash['inherit_from'])
  base_configs(path, inherited_files, file)
    .each_with_index.reverse_each do |base_config, index|
    override_department_setting_for_cops(base_config, hash)
    override_enabled_for_disabled_departments(base_config, hash)
    base_config.each do |k, v|
      next unless v.is_a?(Hash)
      if hash.key?(k)
        v = merge(v, hash[k],
                  cop_name: k, file: file, debug: debug,
                  inherited_file: inherited_files[index],
                  inherit_mode: determine_inherit_mode(hash, k))
      end
      hash[k] = v
      fix_include_paths(base_config.loaded_path, hash, path, k, v) if v.key?('Include')
    end
  end
end