def format_missing_references(missing)
      unless missing.is_a?(Array) && missing.any?
        raise ArgumentError, 'format_missing_references() requires a non-empty array as input'
      end

      formatted_references = missing.map do |obj|
        # obj[:target_value] can be a string or an array. If it's an array, create a
        # separate error message per element of that array. This allows the total number
        # of errors to be correct.
        src_ref = "#{obj[:source]['type'].downcase}[#{obj[:source]['title']}]"
        src_file = format_source_file_line(obj[:source]['file'], obj[:source]['line'])
        target_val = obj[:target_value].is_a?(Array) ? obj[:target_value] : [obj[:target_value]]
        target_val.map { |tv| "#{src_ref}#{src_file} -> #{obj[:target_type].downcase}[#{tv}]" }
      end.flatten
      formatted_references.join('; ')
    end
def format_missing_references(missing)
      unless missing.is_a?(Array) && missing.any?
        raise ArgumentError, 'format_missing_references() requires a non-empty array as input'
      end

      formatted_references = missing.map do |obj|
        # obj[:target_value] can be a string or an array. If it's an array, create a
        # separate error message per element of that array. This allows the total number
        # of errors to be correct.
        src_ref = "#{obj[:source]['type'].downcase}[#{obj[:source]['title']}]"
        src_file = format_source_file_line(obj[:source]['file'], obj[:source]['line'])
        target_val = obj[:target_value].is_a?(Array) ? obj[:target_value] : [obj[:target_value]]
        target_val.map { |tv| "#{src_ref}#{src_file} -> #{obj[:target_type].downcase}[#{tv}]" }
      end.flatten
      formatted_references.join('; ')
    end
Private method: Format the missing references into human-readable text
 Error message will look like this:
 ---
 Catalog has broken references: exec[subscribe caller 1](file:line) -> subscribe[Exec[subscribe target]];
 exec[subscribe caller 2](file:line) -> subscribe[Exec[subscribe target]]; exec[subscribe caller 2](file:line) ->
 subscribe[Exec[subscribe target 2]]
 ---
 @param missing [Array] Array of missing references
 @return [String] Formatted references