<commit_before>require_dependency "hubstats/application_controller"

module Hubstats
  class PullRequestsController < Hubstats::BaseController

    def index
      URI.decode(params[:label]) if params[:label]

      pull_ids = Hubstats::PullRequest
        .belonging_to_users(params[:users])
        .belonging_to_repos(params[:repos])
        .state_based_order(@timespan,params[:state],"ASC")
        .map(&:id)

      @labels = Hubstats::Label.with_a_pull_request(pull_ids).order("pull_request_count DESC")

      @pull_requests = Hubstats::PullRequest.includes(:user, :repo)
        .belonging_to_users(params[:users]).belonging_to_repos(params[:repos])
        .group_by(params[:group]).with_label(params[:label])
        .state_based_order(@timespan,params[:state],params[:order])
        .paginate(:page => params[:page], :per_page => 15)

      grouping(params[:group], @pull_requests)
    end 

    def show
      @repo = Hubstats::Repo.where(name: params[:repo]).first
      @pull_request = Hubstats::PullRequest.belonging_to_repo(@repo.id).where(id: params[:id]).first
      @comments = Hubstats::Comment.belonging_to_pull_request(params[:id]).created_since(@timespan).limit(20)
      comment_count = Hubstats::Comment.belonging_to_pull_request(params[:id]).created_since(@timespan).count(:all)
      @deploys = Hubstats::Deploy.where(id: @pull_request.deploy_id).order("deployed_at DESC")
      @stats_basics = {
        comment_count: comment_count,
        net_additions: @pull_request.additions.to_i - @pull_request.deletions.to_i,
        additions: @pull_request.additions.to_i,
        deletions: @pull_request.deletions.to_i
      }
    end
<commit_msg>getting rid of extraneous lines in pull requests controller<commit_after>require_dependency "hubstats/application_controller"

module Hubstats
  class PullRequestsController < Hubstats::BaseController

    def index
      URI.decode(params[:label]) if params[:label]

      pull_ids = Hubstats::PullRequest
        .belonging_to_users(params[:users])
        .belonging_to_repos(params[:repos])

      @labels = Hubstats::Label.with_a_pull_request(pull_ids).order("pull_request_count DESC")

      @pull_requests = Hubstats::PullRequest.includes(:user, :repo)
        .belonging_to_users(params[:users]).belonging_to_repos(params[:repos])
        .group_by(params[:group]).with_label(params[:label])
        .state_based_order(@timespan,params[:state],params[:order])
        .paginate(:page => params[:page], :per_page => 15)

      grouping(params[:group], @pull_requests)
    end 

    def show
      @repo = Hubstats::Repo.where(name: params[:repo]).first
      @pull_request = Hubstats::PullRequest.belonging_to_repo(@repo.id).where(id: params[:id]).first
      @comments = Hubstats::Comment.belonging_to_pull_request(params[:id]).created_since(@timespan).limit(20)
      comment_count = Hubstats::Comment.belonging_to_pull_request(params[:id]).created_since(@timespan).count(:all)
      @deploys = Hubstats::Deploy.where(id: @pull_request.deploy_id).order("deployed_at DESC")
      @stats_basics = {
        comment_count: comment_count,
        net_additions: @pull_request.additions.to_i - @pull_request.deletions.to_i,
        additions: @pull_request.additions.to_i,
        deletions: @pull_request.deletions.to_i
      }
    end

{'fraction_non_alphanumeric': 0.13337356668678335, 'fraction_numerical': 0.0024140012070006035, 'mean_word_length': 4.461285008237232, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7145282', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1052, 'n_words': 128}