<commit_before>class ProjectsController < ApplicationController
  before_action :ensure_logged_in, only: :your_dependent_repos

  def index
    if current_user && current_user.monitoring_enabled?
      @versions = current_user.all_subscribed_versions.order('published_at DESC').paginate(page: params[:page])
      @projects = current_user.recommended_projects(10)
      render 'dashboard/home'
    else
      facets = Project.facets(:facet_limit => 30)

      @languages = facets[:languages][:terms]
      @platforms = facets[:platforms][:terms]
      @licenses = facets[:licenses][:terms].reject{ |t| t.term.downcase == 'other' }
      @keywords = facets[:keywords][:terms]
    end
  end

  def bus_factor
    if params[:language].present?
      @language = Project.language(params[:language].downcase).first.try(:language)
      raise ActiveRecord::RecordNotFound if @language.nil?
      scope = Project.language(@language)
    else<commit_msg>Only show versions with a published_at<commit_after>class ProjectsController < ApplicationController
  before_action :ensure_logged_in, only: :your_dependent_repos

  def index
    if current_user && current_user.monitoring_enabled?
      @versions = current_user.all_subscribed_versions.where.not(published_at: nil).order('published_at DESC').paginate(page: params[:page])
      @projects = current_user.recommended_projects(10)
      render 'dashboard/home'
    else
      facets = Project.facets(:facet_limit => 30)

      @languages = facets[:languages][:terms]
      @platforms = facets[:platforms][:terms]
      @licenses = facets[:licenses][:terms].reject{ |t| t.term.downcase == 'other' }
      @keywords = facets[:keywords][:terms]
    end
  end

  def bus_factor
    if params[:language].present?
      @language = Project.language(params[:language].downcase).first.try(:language)
      raise ActiveRecord::RecordNotFound if @language.nil?
      scope = Project.language(@language)
    else
{'fraction_non_alphanumeric': 0.1197327852004111, 'fraction_numerical': 0.0041109969167523125, 'mean_word_length': 4.363636363636363, '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': '3937844', 'n_tokens_mistral': 596, 'n_tokens_neox': 559, 'n_words': 105}