<commit_before>class TasksController < ApplicationController
  before_action :set_task, only: [:show, :edit, :update, :destroy, :progress, :assign, :judge, :sprint, :release]
  before_action :set_project, only: [:new, :index, :create]
  before_action :set_validators_for_form_help, only: [:new, :edit]
  before_action :set_validators_for_show, only: [:show]

  before_action :authenticate_thinker!
  before_action :teammate!, only: [:new, :create]

  # GET /projects/1/tasks
  # GET /projects/1/tasks.json
  def index
    puts params
    @filterrific = initialize_filterrific(
      Task,
      params[:filterrific],
      select_options: {
        sorted_by_title: Task.options_for_sorted_by(:title),
        sorted_by_workload: Task.options_for_sorted_by(:workload)
      }
    ) || return
    if params.key?(:filterrific)
      puts 'First cond.'
      @tasks = @filterrific.find

      if params[:filterrific].key?('current_thinker')
        @tasks = @tasks.with_current_thinker(current_thinker)
      end

      if params[:filterrific].key?('project_id')
        @tasks = @tasks.with_project(params[:filterrific][:project_id])
      end

      @tasks = @tasks.page params[:page]
    else
      puts 'Second cond.'
      @tasks = @filterrific.find.where(project: @project).page params[:page]
    end
    @statuses = Status.all
  rescue ActiveRecord::RecordNotFound => e
    # There is an issue with the persisted param_set. Reset it.
    puts "Had to reset filterrific params: #{e.message}"
    redirect_to(reset_filterrific_url(format: :html)) && return
  end

  # GET /tasks/1
  # GET /tasks/1.json
  def show
    @status_sprint      = Status.sprint.first
    @status_release     = Status.release.first
    @status_in_progress = Status.in_progress.first

    @workloads = Workload.all<commit_msg>Removed not useful logs<commit_after>class TasksController < ApplicationController
  before_action :set_task, only: [:show, :edit, :update, :destroy, :progress, :assign, :judge, :sprint, :release]
  before_action :set_project, only: [:new, :index, :create]
  before_action :set_validators_for_form_help, only: [:new, :edit]
  before_action :set_validators_for_show, only: [:show]

  before_action :authenticate_thinker!
  before_action :teammate!, only: [:new, :create]

  # GET /projects/1/tasks
  # GET /projects/1/tasks.json
  def index
    @filterrific = initialize_filterrific(
      Task,
      params[:filterrific],
      select_options: {
        sorted_by_title: Task.options_for_sorted_by(:title),
        sorted_by_workload: Task.options_for_sorted_by(:workload)
      }
    ) || return
    if params.key?(:filterrific)
      @tasks = @filterrific.find

      if params[:filterrific].key?('current_thinker')
        @tasks = @tasks.with_current_thinker(current_thinker)
      end

      if params[:filterrific].key?('project_id')
        @tasks = @tasks.with_project(params[:filterrific][:project_id])
      end

      @tasks = @tasks.page params[:page]
    else
      @tasks = @filterrific.find.where(project: @project).page params[:page]
    end
    @statuses = Status.all
  rescue ActiveRecord::RecordNotFound => e
    # There is an issue with the persisted param_set. Reset it.
    puts "Had to reset filterrific params: #{e.message}"
    redirect_to(reset_filterrific_url(format: :html)) && return
  end

  # GET /tasks/1
  # GET /tasks/1.json
  def show
    @status_sprint      = Status.sprint.first
    @status_release     = Status.release.first
    @status_in_progress = Status.in_progress.first

    @workloads = Workload.all
{'fraction_non_alphanumeric': 0.11840992387933465, 'fraction_numerical': 0.002255427121511136, 'mean_word_length': 3.643979057591623, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '651640', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1147, 'n_words': 242}