<commit_before>class CveController < ApplicationController
  before_filter :login_required
  include ApplicationHelper
  include CveHelper

  def index
    @pageID = 'cve'
  end

  def list
    @pageID = 'cve'
    
    condition = view_mask_to_condition(params[:view_map].to_i)
    @cves = CVE.find(:all, :conditions => [condition], :limit => 1000, :order => 'cve_id DESC')
    
    respond_to do |format|
      format.html
      format.json {
        x = @cves.map {|cve| [cve.id, cve.colorize(:cve_id), CGI.escapeHTML(cve.summary), cve.state]}
        render :text => x.to_json }
    end
  end

  def info
    @cve = CVE.find(:first, :conditions => ['cve_id = ?', params[:id]])
  end

  def new
  end

  def create
  end

  def edit
  end

  def update
  end

  def show
  end

  def store
  end

  def bug_package
    cve_nums = params[:cves].split(',').map{|cve| Integer(cve)}
    logger.debug { "File new Bug; CVElist: " + cve_nums.inspect }

    cves = cve_nums.map {|c| CVE.find(c) }
    cpes = cves.map {|c| c.cpes.map{|cpe| cpe.product } }.flatten.uniq
    
    package_hints = cves.map{|c| c.package_hints }.flatten.uniq.sort
    logger.debug { "CPE Products: " + cpes.inspect }<commit_msg>Remove unneeded methods<commit_after>class CveController < ApplicationController
  before_filter :login_required
  include ApplicationHelper
  include CveHelper

  def index
    @pageID = 'cve'
  end

  def list
    @pageID = 'cve'
    
    condition = view_mask_to_condition(params[:view_map].to_i)
    @cves = CVE.find(:all, :conditions => [condition], :limit => 1000, :order => 'cve_id DESC')
    
    respond_to do |format|
      format.html
      format.json {
        x = @cves.map {|cve| [cve.id, cve.colorize(:cve_id), CGI.escapeHTML(cve.summary), cve.state]}
        render :text => x.to_json }
    end
  end

  def info
    @cve = CVE.find(:first, :conditions => ['cve_id = ?', params[:id]])
  end

  def bug_package
    cve_nums = params[:cves].split(',').map{|cve| Integer(cve)}
    logger.debug { "File new Bug; CVElist: " + cve_nums.inspect }

    cves = cve_nums.map {|c| CVE.find(c) }
    cpes = cves.map {|c| c.cpes.map{|cpe| cpe.product } }.flatten.uniq
    
    package_hints = cves.map{|c| c.package_hints }.flatten.uniq.sort
    logger.debug { "CPE Products: " + cpes.inspect }
{'fraction_non_alphanumeric': 0.1409921671018277, 'fraction_numerical': 0.0034812880765883376, 'mean_word_length': 2.9844020797227038, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2626289', 'n_tokens_mistral': 907, 'n_tokens_neox': 877, 'n_words': 186}