class YARD::Server::Commands::SearchCommand

def search_for_object

def search_for_object
  # rubocop:disable Style/MultilineBlockChain
  self.results = run_verifier(Registry.all).select do |o|
    o.path.downcase.include?(query.downcase)
  end.reject do |o|
    name = (o.type == :method ? o.name(true) : o.name).to_s.downcase
    !name.include?(query.downcase) ||
      case o.type
      when :method
        !(query =~ /[#.]/) && query.include?("::")
      when :class, :module, :constant, :class_variable
        query =~ /[#.]/
      end
  end.sort_by do |o|
    name = (o.type == :method ? o.name(true) : o.name).to_s
    name.length.to_f / query.length.to_f
  end
end