<commit_before>class FaultsController < ApplicationController
  require 'net/http'
  require 'json'
  require 'util'

  # GET /faults
  # GET /faults.json
  def index
    can?(:read, 'faults') do
      skip = params.include?(:page) ? (Integer(params[:page]) - 1) * Rails.configuration.page_size : nil
      if params.has_key?('query')
        @query = ActiveSupport::JSON.decode(URI.unescape(params['query']))
      else<commit_msg>Fix double url unescape in faults search<commit_after>class FaultsController < ApplicationController
  require 'net/http'
  require 'json'
  require 'util'

  # GET /faults
  # GET /faults.json
  def index
    can?(:read, 'faults') do
      skip = params.include?(:page) ? (Integer(params[:page]) - 1) * Rails.configuration.page_size : nil
      if params.has_key?('query')
        @query = ActiveSupport::JSON.decode(params['query'])
      else
{'fraction_non_alphanumeric': 0.1379703534777651, 'fraction_numerical': 0.002280501710376283, 'mean_word_length': 3.6702127659574466, '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': '4874508', 'n_tokens_mistral': 288, 'n_tokens_neox': 275, 'n_words': 63}