<commit_before>require 'erb'
require 'terminal-table'

namespace :qmeter do
  desc "Run Qmeter"
  task :run do
		extend Qmeter
		self.generate_final_report
    puts "======= Saving Current Analysis Details ======="
    self.save_report
    
    rows = []
    rows << ['Security Warning', @warnings_count]
    rows << ['Flog', @flog_average_complexity]
    rows << ['Stats', @stats_code_to_test_ratio]
    rows << ['Rails Best Practices', @rails_best_practices_total]
    table = Terminal::Table.new :title => "Qmeter Analysis", :headings => ['Type', 'Number'], :rows => rows, :style => {:width => 80}
    puts table
    puts "======= Please visit localhost:3000/qmeter for detailed report ======="
  end
end<commit_msg>closed issue#6 added task to generate brakeman and matric_fu report<commit_after>require 'erb'
require 'terminal-table'

namespace :qmeter do
  desc "Run Qmeter"

  task :report do
    puts "*** run brakeman ***"

    system "brakeman -o report.html -o report.json"

    puts "*** run metric_fu ***"

    system "metric_fu --out $current_dir/public/metric_fu"

  end

  task :run do
    extend Qmeter
    self.generate_final_report
    puts "======= Saving Current Analysis Details ======="
    self.save_report

    rows = []
    rows << ['Security Warning', @warnings_count]
    rows << ['Flog', @flog_average_complexity]
    rows << ['Stats', @stats_code_to_test_ratio]
    rows << ['Rails Best Practices', @rails_best_practices_total]
    table = Terminal::Table.new :title => "Qmeter Analysis", :headings => ['Type', 'Number'], :rows => rows, :style => {:width => 80}
    puts table
    puts "======= Please visit localhost:3000/qmeter for detailed report ======="
  end
end
{'fraction_non_alphanumeric': 0.15488810365135453, 'fraction_numerical': 0.0076560659599528855, 'mean_word_length': 3.938953488372093, 'pattern_counts': {'":': 0, '<': 19, '<?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': '1419734', 'n_tokens_mistral': 577, 'n_tokens_neox': 533, 'n_words': 152}