<commit_before>class SearchResultsController < ApplicationController
  decorates_assigned :search_results, with: SearchResultCollectionDecorator

  def index
    if params[:query].present?
      @search_results = PerformCorrectiveSearch.new(params[:query], params[:page]).call

      if @search_results.any?
        render 'search_results/index_with_results'
      else
        render 'search_results/index_no_results'
      end
    end
  end

  private<commit_msg>Use a guard clause instead of wrapping the code inside a conditional expression<commit_after>class SearchResultsController < ApplicationController
  decorates_assigned :search_results, with: SearchResultCollectionDecorator

  def index
    return if params[:query].blank?

    @search_results = PerformCorrectiveSearch.new(params[:query], params[:page]).call

    if @search_results.any?
      render 'search_results/index_with_results'
    else
      render 'search_results/index_no_results'
    end
  end

  private
{'fraction_non_alphanumeric': 0.06924643584521385, 'fraction_numerical': 0.0, 'mean_word_length': 4.461111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6191931', 'n_tokens_mistral': 272, 'n_tokens_neox': 260, 'n_words': 61}