--- :flay: :total_score: "476" :matches: - :reason: 1) Similar code found in :module (mass = 252) :matches: - :line: "2" :name: lib/graphs/flay_grapher.rb - :line: "2" :name: lib/graphs/roodi_grapher.rb - :reason: 2) Similar code found in :defn (mass = 90) :matches: - :line: "11" :name: lib/generators/flay.rb - :line: "11" :name: lib/generators/reek.rb - :line: "10" :name: lib/generators/roodi.rb - :reason: 3) Similar code found in :defn (mass = 54) :matches: - :line: "76" :name: lib/base/generator.rb - :line: "82" :name: lib/base/generator.rb - :line: "88" :name: lib/base/generator.rb - :reason: 4) Similar code found in :attrasgn (mass = 48) :matches: - :line: "18" :name: lib/generators/stats.rb - :line: "19" :name: lib/generators/stats.rb - :line: "20" :name: lib/generators/stats.rb - :reason: 5) Similar code found in :lasgn (mass = 32) :matches: - :line: "12" :name: lib/generators/stats.rb - :line: "13" :name: lib/generators/stats.rb :rcov: lib/generators/reek.rb: :percent_run: 32 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Reek < Generator" - :was_run: true :content: " REEK_REGEX = /^(\\S+) (.*) \\((.*)\\)$/" - :was_run: true :content: " " - :was_run: true :content: " def self.verify_dependencies!" - :was_run: false :content: " `reek --help`" - :was_run: false :content: " raise 'sudo gem install reek # if you want the reek tasks' unless $?.success?" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " files_to_reek = MetricFu.reek[:dirs_to_reek].map{|dir| Dir[File.join(dir, \"**/*.rb\")] }" - :was_run: false :content: " @output = `reek #{files_to_reek.join(\" \")}`" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " @matches = @output.chomp.split(\"\\n\\n\").map{|m| m.split(\"\\n\") }" - :was_run: false :content: " @matches = @matches.map do |match|" - :was_run: false :content: " file_path = match.shift.split('--').first" - :was_run: false :content: " file_path = file_path.gsub('\"', ' ').strip" - :was_run: false :content: " code_smells = match.map do |smell|" - :was_run: false :content: " match_object = smell.match(REEK_REGEX)" - :was_run: false :content: " next unless match_object" - :was_run: false :content: " {:method => match_object[1].strip," - :was_run: false :content: " :message => match_object[2].strip," - :was_run: false :content: " :type => match_object[3].strip}" - :was_run: false :content: " end.compact" - :was_run: false :content: " {:file_path => file_path, :code_smells => code_smells}" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:reek => {:matches => @matches}}" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " end" lib/graphs/roodi_grapher.rb: :percent_run: 35 :lines: - :was_run: true :content: " require 'gruff'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class RoodiGrapher" - :was_run: true :content: " " - :was_run: true :content: " attr_accessor :roodi_count, :labels" - :was_run: true :content: " " - :was_run: true :content: " def initialize" - :was_run: false :content: " self.roodi_count = []" - :was_run: false :content: " self.labels = {}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_metrics(metrics, date)" - :was_run: false :content: " self.roodi_count.push(metrics[:roodi][:problems].size)" - :was_run: false :content: " self.labels.update( { self.labels.size => date })" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def graph!" - :was_run: false :content: " g = Gruff::Line.new(MetricFu.graph_size)" - :was_run: false :content: " g.title = \"Roodi: design problems\"" - :was_run: false :content: " g.theme = MetricFu.graph_theme" - :was_run: false :content: " g.font = MetricFu.graph_font" - :was_run: false :content: " g.data('roodi', self.roodi_count)" - :was_run: false :content: " g.labels = self.labels" - :was_run: false :content: " g.title_font_size = MetricFu.graph_title_font_size" - :was_run: false :content: " g.legend_box_size = MetricFu.graph_legend_box_size" - :was_run: false :content: " g.legend_font_size = MetricFu.graph_legend_font_size" - :was_run: false :content: " g.marker_font_size = MetricFu.graph_marker_font_size" - :was_run: false :content: " g.write(File.join(MetricFu.output_directory, 'roodi.png'))" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" lib/generators/saikuro.rb: :percent_run: 23 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Saikuro < Generator" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " relative_path = [File.dirname(__FILE__), '..', '..'," - :was_run: false :content: " 'vendor', 'saikuro', 'saikuro.rb']" - :was_run: false :content: " saikuro = File.expand_path(File.join(relative_path))" - :was_run: false :content: " " - :was_run: false :content: " MetricFu.saikuro[:input_directory] = format_directories" - :was_run: false :content: " " - :was_run: false :content: " options_string = MetricFu.saikuro.inject(\"\") do |options, option|" - :was_run: false :content: " options + \"--#{option.join(' ')} \"" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " sh %{ruby \"#{saikuro}\" #{options_string}} do |ok, response|" - :was_run: false :content: " unless ok" - :was_run: false :content: " puts \"Saikuro failed with exit status: #{response.exitstatus}\"" - :was_run: false :content: " exit 1" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def format_directories" - :was_run: false :content: " dirs = MetricFu.saikuro[:input_directory].join(\" | \")" - :was_run: false :content: " \"\\\"#{dirs}\\\"\"" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " @files = []" - :was_run: false :content: " saikuro_results.each do |path|" - :was_run: false :content: " if Saikuro::SFile.is_valid_text_file?(path)" - :was_run: false :content: " file = Saikuro::SFile.new(path)" - :was_run: false :content: " if file" - :was_run: false :content: " @files << file" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " @files = @files.sort_by do |file|" - :was_run: false :content: " file.elements." - :was_run: false :content: " max {|a,b| a.complexity.to_i <=> b.complexity.to_i}." - :was_run: false :content: " complexity.to_i" - :was_run: false :content: " end" - :was_run: false :content: " @files.reverse!" - :was_run: false :content: " klasses = []" - :was_run: false :content: " @files.each {|f| klasses << f.elements}" - :was_run: false :content: " klasses.flatten!" - :was_run: false :content: " @classes = klasses.sort_by {|k| k.complexity.to_i}" - :was_run: false :content: " @classes.reverse!" - :was_run: false :content: " meths = []" - :was_run: false :content: " @files.each {|f|" - :was_run: false :content: " f.elements.each {|el|" - :was_run: false :content: " el.defs.each {|defn|" - :was_run: false :content: " defn.name = \"#{el.name}##{defn.name}\"" - :was_run: false :content: " meths << defn}" - :was_run: false :content: " }" - :was_run: false :content: " }" - :was_run: false :content: " meths = meths.sort_by {|meth| meth.complexity.to_i}" - :was_run: false :content: " @meths = meths.reverse" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " files = @files.map do |file|" - :was_run: false :content: " my_file = file.to_h" - :was_run: false :content: " my_file[:filename] = file.filename" - :was_run: false :content: " my_file" - :was_run: false :content: " end" - :was_run: false :content: " {:saikuro => {:files => files," - :was_run: false :content: " :classes => @classes.map {|c| c.to_h}," - :was_run: false :content: " :methods => @meths.map {|m| m.to_h}" - :was_run: false :content: " }" - :was_run: false :content: " }" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def saikuro_results" - :was_run: false :content: " Dir.glob(\"#{metric_directory}/**/*.html\")" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Saikuro::SFile" - :was_run: true :content: " " - :was_run: true :content: " attr_reader :elements" - :was_run: true :content: " " - :was_run: true :content: " def initialize(path)" - :was_run: false :content: " @path = path" - :was_run: false :content: " @file_handle = File.open(@path, \"r\")" - :was_run: false :content: " @elements = []" - :was_run: false :content: " get_elements" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def self.is_valid_text_file?(path)" - :was_run: false :content: " File.open(path, \"r\") do |f|" - :was_run: false :content: " if f.eof? || !f.readline.match(/--/)" - :was_run: false :content: " return false" - :was_run: false :content: " else" - :was_run: false :content: " return true" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def filename" - :was_run: false :content: " File.basename(@path, '_cyclo.html')" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " merge_classes" - :was_run: false :content: " {:classes => @elements}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_elements" - :was_run: false :content: " begin" - :was_run: false :content: " while (line = @file_handle.readline) do" - :was_run: false :content: " return [] if line.nil? || line !~ /\\S/" - :was_run: false :content: " element ||= nil" - :was_run: false :content: " if line.match /START/" - :was_run: false :content: " unless element.nil?" - :was_run: false :content: " @elements << element" - :was_run: false :content: " element = nil" - :was_run: false :content: " end" - :was_run: false :content: " line = @file_handle.readline" - :was_run: false :content: " element = Saikuro::ParsingElement.new(line)" - :was_run: false :content: " elsif line.match /END/" - :was_run: false :content: " @elements << element unless element.nil?" - :was_run: false :content: " element = nil" - :was_run: false :content: " else" - :was_run: false :content: " element << line" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " rescue EOFError" - :was_run: false :content: " nil" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def merge_classes" - :was_run: false :content: " new_elements = []" - :was_run: false :content: " get_class_names.each do |target_class|" - :was_run: false :content: " elements = @elements.find_all {|el| el.name == target_class }" - :was_run: false :content: " complexity = 0" - :was_run: false :content: " lines = 0" - :was_run: false :content: " defns = []" - :was_run: false :content: " elements.each do |el|" - :was_run: false :content: " complexity += el.complexity.to_i" - :was_run: false :content: " lines += el.lines.to_i" - :was_run: false :content: " defns << el.defs" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " new_element = {:class_name => target_class," - :was_run: false :content: " :complexity => complexity," - :was_run: false :content: " :lines => lines," - :was_run: false :content: " :methods => defns.flatten.map {|d| d.to_h}}" - :was_run: false :content: " new_element[:methods] = new_element[:methods]." - :was_run: false :content: " sort_by {|x| x[:complexity] }." - :was_run: false :content: " reverse" - :was_run: false :content: " " - :was_run: false :content: " new_elements << new_element" - :was_run: false :content: " end" - :was_run: false :content: " @elements = new_elements if new_elements" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_class_names" - :was_run: false :content: " class_names = []" - :was_run: false :content: " @elements.each do |element|" - :was_run: false :content: " unless class_names.include?(element.name)" - :was_run: false :content: " class_names << element.name" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " class_names" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Saikuro::ParsingElement" - :was_run: true :content: " TYPE_REGEX=/Type:(.*) Name/" - :was_run: true :content: " NAME_REGEX=/Name:(.*) Complexity/" - :was_run: true :content: " COMPLEXITY_REGEX=/Complexity:(.*) Lines/" - :was_run: true :content: " LINES_REGEX=/Lines:(.*)/" - :was_run: true :content: " " - :was_run: true :content: " attr_reader :complexity, :lines, :defs, :element_type" - :was_run: true :content: " attr_accessor :name" - :was_run: true :content: " " - :was_run: true :content: " def initialize(line)" - :was_run: false :content: " @line = line" - :was_run: false :content: " @element_type = line.match(TYPE_REGEX)[1].strip" - :was_run: false :content: " @name = line.match(NAME_REGEX)[1].strip" - :was_run: false :content: " @complexity = line.match(COMPLEXITY_REGEX)[1].strip" - :was_run: false :content: " @lines = line.match(LINES_REGEX)[1].strip" - :was_run: false :content: " @defs = []" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def <<(line)" - :was_run: false :content: " @defs << Saikuro::ParsingElement.new(line)" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " base = {:name => @name, :complexity => @complexity.to_i, :lines => @lines.to_i}" - :was_run: false :content: " unless @defs.empty?" - :was_run: false :content: " defs = @defs.map do |my_def|" - :was_run: false :content: " my_def = my_def.to_h" - :was_run: false :content: " my_def.delete(:defs)" - :was_run: false :content: " my_def" - :was_run: false :content: " end" - :was_run: false :content: " base[:defs] = defs" - :was_run: false :content: " end" - :was_run: false :content: " return base" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/generators/churn.rb: :percent_run: 42 :lines: - :was_run: true :content: " require 'chronic'" - :was_run: true :content: " require 'generator'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Churn < Generator" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def initialize(options={})" - :was_run: false :content: " super" - :was_run: false :content: " if self.class.git?" - :was_run: false :content: " @source_control = Git.new(MetricFu.churn[:start_date])" - :was_run: false :content: " elsif File.exist?(\".svn\")" - :was_run: false :content: " @source_control = Svn.new(MetricFu.churn[:start_date])" - :was_run: false :content: " else" - :was_run: false :content: " raise \"Churning requires a subversion or git repo\"" - :was_run: false :content: " end" - :was_run: false :content: " @minimum_churn_count = MetricFu.churn[:minimum_churn_count] || 5" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def self.git?" - :was_run: false :content: " system(\"git branch\")" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " @changes = parse_log_for_changes.reject {|file, change_count| change_count < @minimum_churn_count}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " @changes = @changes.to_a.sort {|x,y| y[1] <=> x[1]}" - :was_run: false :content: " @changes = @changes.map {|change| {:file_path => change[0], :times_changed => change[1] }}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:churn => {:changes => @changes}}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " private" - :was_run: true :content: " " - :was_run: true :content: " def parse_log_for_changes" - :was_run: false :content: " changes = {}" - :was_run: false :content: " " - :was_run: false :content: " logs = @source_control.get_logs" - :was_run: false :content: " logs.each do |line|" - :was_run: false :content: " changes[line] ? changes[line] += 1 : changes[line] = 1" - :was_run: false :content: " end" - :was_run: false :content: " changes" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " class SourceControl" - :was_run: true :content: " def initialize(start_date=nil)" - :was_run: false :content: " @start_date = start_date" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Git < SourceControl" - :was_run: true :content: " def get_logs" - :was_run: false :content: " `git log #{date_range} --name-only --pretty=format:`.split(/\\n/).reject{|line| line == \"\"}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " private" - :was_run: true :content: " def date_range" - :was_run: false :content: " if @start_date" - :was_run: false :content: " date = Chronic.parse(@start_date)" - :was_run: false :content: " \"--after=#{date.strftime('%Y-%m-%d')}\"" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Svn < SourceControl" - :was_run: true :content: " def get_logs" - :was_run: false :content: " `svn log #{date_range} --verbose`.split(/\\n/).map { |line| clean_up_svn_line(line) }.compact" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " private" - :was_run: true :content: " def date_range" - :was_run: false :content: " if @start_date" - :was_run: false :content: " date = Chronic.parse(@start_date)" - :was_run: false :content: " \"--revision {#{date.strftime('%Y-%m-%d')}}:{#{Time.now.strftime('%Y-%m-%d')}}\"" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def clean_up_svn_line(line)" - :was_run: false :content: " m = line.match(/\\W*[A,M]\\W+(\\/.*)\\b/)" - :was_run: false :content: " m ? m[1] : nil" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " end" lib/graphs/reek_grapher.rb: :percent_run: 27 :lines: - :was_run: true :content: " require 'gruff'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class ReekGrapher" - :was_run: true :content: " " - :was_run: true :content: " attr_accessor :reek_count, :labels" - :was_run: true :content: " " - :was_run: true :content: " def initialize" - :was_run: false :content: " self.reek_count = {}" - :was_run: false :content: " self.labels= {}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_metrics(metrics, date)" - :was_run: false :content: " counter = self.labels.size" - :was_run: false :content: " self.labels.update( { counter => date })" - :was_run: false :content: " " - :was_run: false :content: " metrics[:reek][:matches].each do |reek_chunk|" - :was_run: false :content: " reek_chunk[:code_smells].each do |code_smell|" - :was_run: false :content: " # speaking of code smell..." - :was_run: false :content: " self.reek_count[code_smell[:type]] = [] if self.reek_count[code_smell[:type]].nil?" - :was_run: false :content: " self.reek_count[code_smell[:type]][counter].nil? ? self.reek_count[code_smell[:type]][counter] = 1 : self.reek_count[code_smell[:type]][counter] += 1" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def graph!" - :was_run: false :content: " g = Gruff::Line.new(MetricFu.graph_size)" - :was_run: false :content: " g.title = \"Reek: code smells\"" - :was_run: false :content: " g.theme = MetricFu.graph_theme" - :was_run: false :content: " g.font = MetricFu.graph_font" - :was_run: false :content: " self.reek_count.each_pair do |type, count|" - :was_run: false :content: " g.data(type, count)" - :was_run: false :content: " end" - :was_run: false :content: " g.labels = self.labels" - :was_run: false :content: " g.title_font_size = MetricFu.graph_title_font_size" - :was_run: false :content: " g.legend_box_size = MetricFu.graph_legend_box_size" - :was_run: false :content: " g.legend_font_size = MetricFu.graph_legend_font_size" - :was_run: false :content: " g.marker_font_size = MetricFu.graph_marker_font_size" - :was_run: false :content: " g.write(File.join(MetricFu.output_directory, 'reek.png'))" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" lib/generators/stats.rb: :percent_run: 21 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Stats < Generator" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " `rake stats > #{metric_directory + '/stats.txt'}`" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " output = File.open(metric_directory + '/stats.txt').read" - :was_run: false :content: " output = output.split(\"\\n\")" - :was_run: false :content: " output = output.find_all {|line| line[0].chr != \"+\" }" - :was_run: false :content: " output = output.find_all {|line| line[0].chr != \"(\" }" - :was_run: false :content: " output.shift" - :was_run: false :content: " totals = output.pop" - :was_run: false :content: " totals = totals.split(\" \").find_all {|el| ! el.empty? }" - :was_run: false :content: " @stats = {}" - :was_run: false :content: " @stats[:codeLOC] = totals[0].match(/\\d.*/)[0].to_i" - :was_run: false :content: " @stats[:testLOC] = totals[1].match(/\\d.*/)[0].to_i" - :was_run: false :content: " @stats[:code_to_test_ratio] = totals[2].match(/1\\:(\\d.*)/)[1].to_f" - :was_run: false :content: " " - :was_run: false :content: " @stats[:lines] = output.map do |line|" - :was_run: false :content: " elements = line.split(\"|\")" - :was_run: false :content: " elements.map! {|el| el.strip }" - :was_run: false :content: " elements = elements.find_all {|el| ! el.empty? }" - :was_run: false :content: " info_line = {}" - :was_run: false :content: " info_line[:name] = elements.shift" - :was_run: false :content: " elements.map! {|el| el.to_i }" - :was_run: false :content: " [:lines, :loc, :classes, :methods, " - :was_run: false :content: " :methods_per_class, :loc_per_method].each do |sym|" - :was_run: false :content: " info_line[sym] = elements.shift" - :was_run: false :content: " end" - :was_run: false :content: " info_line" - :was_run: false :content: " end" - :was_run: false :content: " @stats" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:stats => @stats}" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " end" lib/base/report.rb: :percent_run: 76 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " # MetricFu.report memoizes access to a Report object, that will be" - :was_run: true :content: " # used throughout the lifecycle of the MetricFu app." - :was_run: true :content: " def self.report" - :was_run: false :content: " @report ||= Report.new" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # = Report" - :was_run: true :content: " #" - :was_run: true :content: " # The Report class is responsible two things:" - :was_run: true :content: " #" - :was_run: true :content: " # It adds information to the yaml report, produced by the system " - :was_run: true :content: " # as a whole, for each of the generators used in this test run." - :was_run: true :content: " #" - :was_run: true :content: " # It also handles passing the information from each generator used" - :was_run: true :content: " # in this test run out to the template class set in " - :was_run: true :content: " # MetricFu::Configuration." - :was_run: true :content: " class Report" - :was_run: true :content: " " - :was_run: true :content: " # Renders the result of the report_hash into a yaml serialization" - :was_run: true :content: " # ready for writing out to a file." - :was_run: true :content: " #" - :was_run: true :content: " # @return YAML" - :was_run: true :content: " # A YAML object containing the results of the report generation " - :was_run: true :content: " # process" - :was_run: true :content: " def to_yaml" - :was_run: false :content: " report_hash.to_yaml" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def report_hash #:nodoc:" - :was_run: false :content: " @report_hash ||= {}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Instantiates a new template class based on the configuration set" - :was_run: true :content: " # in MetricFu::Configuration, or through the MetricFu.config block" - :was_run: true :content: " # in your rake file (defaults to the included StandardTemplate) and" - :was_run: true :content: " # assigns the report_hash to the report_hash to the template and" - :was_run: true :content: " # asks itself to write itself out." - :was_run: true :content: " def save_templatized_report" - :was_run: false :content: " @template = MetricFu.template_class.new" - :was_run: false :content: " @template.report = report_hash" - :was_run: false :content: " @template.write" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Adds a hash from a passed report, produced by one of the Generator" - :was_run: true :content: " # classes to the aggregate report_hash managed by this hash." - :was_run: true :content: " #" - :was_run: true :content: " # @param report_type Hash" - :was_run: true :content: " # The hash to add to the aggregate report_hash" - :was_run: true :content: " def add(report_type)" - :was_run: false :content: " clazz = MetricFu.const_get(report_type.to_s.capitalize)" - :was_run: false :content: " report_hash.merge!(clazz.generate_report)" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Saves the passed in content to the passed in directory. If" - :was_run: true :content: " # a filename is passed in it will be used as the name of the " - :was_run: true :content: " # file, otherwise it will default to 'index.html'" - :was_run: true :content: " #" - :was_run: true :content: " # @param content String" - :was_run: true :content: " # A string containing the content (usually html) to be written" - :was_run: true :content: " # to the file." - :was_run: true :content: " #" - :was_run: true :content: " # @param dir String" - :was_run: true :content: " # A dir containing the path to the directory to write the file in." - :was_run: true :content: " #" - :was_run: true :content: " # @param file String" - :was_run: true :content: " # A filename to save the path as. Defaults to 'index.html'." - :was_run: true :content: " #" - :was_run: true :content: " def save_output(content, dir, file='index.html')" - :was_run: false :content: " open(\"#{dir}/#{file}\", \"w\") do |f|" - :was_run: false :content: " f.puts content" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Checks to discover whether we should try and open the results" - :was_run: true :content: " # of the report in the browser on this system. We only try and open" - :was_run: true :content: " # in the browser if we're on OS X and we're not running in a " - :was_run: true :content: " # CruiseControl.rb environment. See MetricFu.configuration for more" - :was_run: true :content: " # details about how we make those guesses." - :was_run: true :content: " #" - :was_run: true :content: " # @return Boolean" - :was_run: true :content: " # Should we open in the browser or not?" - :was_run: true :content: " def open_in_browser?" - :was_run: false :content: " MetricFu.configuration.platform.include?('darwin') &&" - :was_run: false :content: " ! MetricFu.configuration.is_cruise_control_rb?" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Shows 'index.html' from the passed directory in the browser" - :was_run: true :content: " # if we're able to open the browser on this platform." - :was_run: true :content: " #" - :was_run: true :content: " # @param dir String" - :was_run: true :content: " # The directory path where the 'index.html' we want to open is " - :was_run: true :content: " # stored" - :was_run: true :content: " def show_in_browser(dir)" - :was_run: false :content: " system(\"open #{dir}/index.html\") if open_in_browser?" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/generators/rcov.rb: :percent_run: 25 :lines: - :was_run: true :content: " require 'enumerator'" - :was_run: true :content: " " - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Rcov < Generator" - :was_run: true :content: " NEW_FILE_MARKER = (\"=\" * 80) + \"\\n\"" - :was_run: true :content: " " - :was_run: true :content: " def self.verify_dependencies!" - :was_run: false :content: " `flay --help`" - :was_run: false :content: " unless $?.success?" - :was_run: false :content: " if RUBY_PLATFORM =~ /java/" - :was_run: false :content: " raise 'running in jruby - rcov tasks not available'" - :was_run: false :content: " else" - :was_run: false :content: " raise 'sudo gem install rcov # if you want the rcov tasks'" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Line" - :was_run: true :content: " attr_accessor :content, :was_run" - :was_run: true :content: " " - :was_run: true :content: " def initialize(content, was_run)" - :was_run: false :content: " @content = content" - :was_run: false :content: " @was_run = was_run" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:content => @content, :was_run => @was_run}" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " begin" - :was_run: false :content: " FileUtils.rm_rf(MetricFu::Rcov.metric_directory, :verbose => false)" - :was_run: false :content: " Dir.mkdir(MetricFu::Rcov.metric_directory)" - :was_run: false :content: " test_files = FileList[*MetricFu.rcov[:test_files]].join(' ')" - :was_run: false :content: " rcov_opts = MetricFu.rcov[:rcov_opts].join(' ')" - :was_run: false :content: " output = \">> #{MetricFu::Rcov.metric_directory}/rcov.txt\"" - :was_run: false :content: " `rcov --include-file #{test_files} #{rcov_opts} #{output}`" - :was_run: false :content: " rescue LoadError" - :was_run: false :content: " if RUBY_PLATFORM =~ /java/" - :was_run: false :content: " puts 'running in jruby - rcov tasks not available'" - :was_run: false :content: " else" - :was_run: false :content: " puts 'sudo gem install rcov # if you want the rcov tasks'" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " output = File.open(MetricFu::Rcov.metric_directory + '/rcov.txt').read" - :was_run: false :content: " output = output.split(NEW_FILE_MARKER)" - :was_run: false :content: " # Throw away the first entry - it's the execution time etc." - :was_run: false :content: " output.shift" - :was_run: false :content: " files = {}" - :was_run: false :content: " output.each_slice(2) {|out| files[out.first.strip] = out.last}" - :was_run: false :content: " files.each_pair {|fname, content| files[fname] = content.split(\"\\n\") }" - :was_run: false :content: " files.each_pair do |fname, content|" - :was_run: false :content: " content.map! do |raw_line|" - :was_run: false :content: " if raw_line.match(/^ /)" - :was_run: false :content: " line = Line.new(raw_line.gsub(' ', ' '), false).to_h" - :was_run: false :content: " else" - :was_run: false :content: " line = Line.new(raw_line, true).to_h" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " files[fname] = {:lines => content}" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " # Calculate the percentage of lines run in each file" - :was_run: false :content: " @global_total_lines = 0" - :was_run: false :content: " @global_total_lines_run = 0" - :was_run: false :content: " files.each_pair do |fname, content|" - :was_run: false :content: " lines = content[:lines]" - :was_run: false :content: " @global_total_lines_run += lines_run = lines.find_all {|line| line[:was_run] == true }.length" - :was_run: false :content: " @global_total_lines += total_lines = lines.length" - :was_run: false :content: " percent_run = ((lines_run.to_f / total_lines.to_f) * 100).round" - :was_run: false :content: " files[fname][:percent_run] = percent_run " - :was_run: false :content: " end" - :was_run: false :content: " @rcov = files" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " global_percent_run = ((@global_total_lines_run.to_f / @global_total_lines.to_f) * 100)" - :was_run: false :content: " {:rcov => @rcov.merge({:global_percent_run => round_to_tenths(global_percent_run) })} " - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/generators/roodi.rb: :percent_run: 35 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " class Roodi < Generator" - :was_run: true :content: " " - :was_run: true :content: " def self.verify_dependencies!" - :was_run: false :content: " `roodi --help`" - :was_run: false :content: " raise 'sudo gem install roodi # if you want the roodi tasks' unless $?.success?" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " files_to_analyze = MetricFu.roodi[:dirs_to_roodi].map{|dir| Dir[File.join(dir, \"**/*.rb\")] }" - :was_run: false :content: " @output = `roodi #{files_to_analyze.join(\" \")}`" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " @matches = @output.chomp.split(\"\\n\").map{|m| m.split(\" - \") }" - :was_run: false :content: " total = @matches.pop" - :was_run: false :content: " @matches.reject! {|array| array.empty? }" - :was_run: false :content: " @matches.map! do |match|" - :was_run: false :content: " file, line = match[0].split(':')" - :was_run: false :content: " problem = match[1]" - :was_run: false :content: " {:file => file, :line => line, :problem => problem}" - :was_run: false :content: " end" - :was_run: false :content: " @roodi_results = {:total => total, :problems => @matches}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:roodi => @roodi_results}" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/generators/flay.rb: :percent_run: 35 :lines: - :was_run: true :content: " require 'generator'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Flay < Generator" - :was_run: true :content: " " - :was_run: true :content: " def self.verify_dependencies!" - :was_run: false :content: " `flay --help`" - :was_run: false :content: " raise 'sudo gem install flay # if you want the flay tasks' unless $?.success?" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: false :content: " files_to_flay = MetricFu.flay[:dirs_to_flay].map{|dir| Dir[File.join(dir, \"**/*.rb\")] }" - :was_run: false :content: " @output = `flay #{files_to_flay.join(\" \")}`" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " @matches = @output.chomp.split(\"\\n\\n\").map{|m| m.split(\"\\n \") }" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " target = []" - :was_run: false :content: " total_score = @matches.shift.first.split('=').last.strip" - :was_run: false :content: " @matches.each do |problem|" - :was_run: false :content: " reason = problem.shift.strip" - :was_run: false :content: " lines_info = problem.map do |full_line|" - :was_run: false :content: " name, line = full_line.split(\":\")" - :was_run: false :content: " {:name => name.strip, :line => line.strip}" - :was_run: false :content: " end" - :was_run: false :content: " target << [:reason => reason, :matches => lines_info]" - :was_run: false :content: " end" - :was_run: false :content: " {:flay => {:total_score => total_score, :matches => target.flatten}}" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/base/configuration.rb: :percent_run: 91 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " # A list of metrics which are available in the MetricFu system." - :was_run: true :content: " #" - :was_run: true :content: " # These are metrics which have been developed for the system. Of" - :was_run: true :content: " # course, in order to use these metrics, their respective gems must" - :was_run: true :content: " # be installed on the system." - :was_run: true :content: " AVAILABLE_METRICS = [:churn, :flog, :flay, :reek, " - :was_run: true :content: " :roodi, :saikuro, :rcov]" - :was_run: true :content: " " - :was_run: true :content: " AVAILABLE_GRAPHS = [:flog, :flay, :reek, :roodi, :rcov]" - :was_run: true :content: " " - :was_run: true :content: " # The @@configuration class variable holds a global type configuration" - :was_run: true :content: " # object for any parts of the system to use." - :was_run: true :content: " def self.configuration" - :was_run: true :content: " @@configuration ||= Configuration.new" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # = Configuration" - :was_run: true :content: " #" - :was_run: true :content: " # The Configuration class, as it sounds, provides methods for" - :was_run: true :content: " # configuring the behaviour of MetricFu." - :was_run: true :content: " #" - :was_run: true :content: " # == Customization for Rails" - :was_run: true :content: " #" - :was_run: true :content: " # The Configuration class checks for the presence of a" - :was_run: true :content: " # 'config/environment.rb' file. If the file is present, it assumes" - :was_run: true :content: " # it is running in a Rails project. If it is, it will:" - :was_run: true :content: " #" - :was_run: true :content: " # * Add 'app' to the @code_dirs directory to include the" - :was_run: true :content: " # code in the app directory in the processing" - :was_run: true :content: " # * Add :stats to the list of metrics to run to get the Rails stats" - :was_run: true :content: " # task" - :was_run: true :content: " #" - :was_run: true :content: " # == Customization for CruiseControl.rb" - :was_run: true :content: " #" - :was_run: true :content: " # The Configuration class checks for the presence of a " - :was_run: true :content: " # 'CC_BUILD_ARTIFACTS' environment variable. If it's found" - :was_run: true :content: " # it will change the default output directory from the default" - :was_run: true :content: " # \"tmp/metric_fu to the directory represented by 'CC_BUILD_ARTIFACTS'" - :was_run: true :content: " #" - :was_run: true :content: " # == Deprications" - :was_run: true :content: " #" - :was_run: true :content: " # The Configuration class checks for several deprecated constants" - :was_run: true :content: " # that were previously used to configure MetricFu. These include" - :was_run: true :content: " # CHURN_OPTIONS, DIRECTORIES_TO_FLOG, SAIKURO_OPTIONS, " - :was_run: true :content: " # and MetricFu::SAIKURO_OPTIONS." - :was_run: true :content: " #" - :was_run: true :content: " # These have been replaced by config.churn, config.flog and" - :was_run: true :content: " # config.saikuro respectively." - :was_run: true :content: " class Configuration" - :was_run: true :content: " " - :was_run: true :content: " def initialize #:nodoc:#" - :was_run: true :content: " warn_about_deprecated_config_options" - :was_run: true :content: " reset" - :was_run: true :content: " add_attr_accessors_to_self" - :was_run: true :content: " add_class_methods_to_metric_fu" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Searches through the instance variables of the class and" - :was_run: true :content: " # creates a class method on the MetricFu module to read the value" - :was_run: true :content: " # of the instance variable from the Configuration class." - :was_run: true :content: " def add_class_methods_to_metric_fu" - :was_run: true :content: " instance_variables.each do |name|" - :was_run: true :content: " method_name = name[1..-1].to_sym" - :was_run: true :content: " method = <<-EOF" - :was_run: true :content: " def self.#{method_name}" - :was_run: true :content: " configuration.send(:#{method_name})" - :was_run: true :content: " end" - :was_run: true :content: " EOF" - :was_run: true :content: " MetricFu.module_eval(method)" - :was_run: true :content: " end" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Searches through the instance variables of the class and creates" - :was_run: true :content: " # an attribute accessor on this instance of the Configuration " - :was_run: true :content: " # class for each instance variable." - :was_run: true :content: " def add_attr_accessors_to_self" - :was_run: true :content: " instance_variables.each do |name|" - :was_run: true :content: " method_name = name[1..-1].to_sym" - :was_run: true :content: " MetricFu::Configuration.send(:attr_accessor, method_name)" - :was_run: true :content: " end" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Check if certain constants that are deprecated have been" - :was_run: true :content: " # assigned. If so, warn the user about them, and the " - :was_run: true :content: " # fact that they will have no effect." - :was_run: true :content: " def warn_about_deprecated_config_options" - :was_run: true :content: " if defined?(::MetricFu::CHURN_OPTIONS)" - :was_run: false :content: " raise(\"Use config.churn instead of MetricFu::CHURN_OPTIONS\")" - :was_run: false :content: " end" - :was_run: true :content: " if defined?(::MetricFu::DIRECTORIES_TO_FLOG)" - :was_run: false :content: " raise(\"Use config.flog[:dirs_to_flog] \"+" - :was_run: false :content: " \"instead of MetricFu::DIRECTORIES_TO_FLOG\") " - :was_run: false :content: " end" - :was_run: true :content: " if defined?(::MetricFu::SAIKURO_OPTIONS)" - :was_run: false :content: " raise(\"Use config.saikuro instead of MetricFu::SAIKURO_OPTIONS\")" - :was_run: false :content: " end" - :was_run: true :content: " if defined?(SAIKURO_OPTIONS)" - :was_run: false :content: " raise(\"Use config.saikuro instead of SAIKURO_OPTIONS\")" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # This allows us to have a nice syntax like:" - :was_run: true :content: " #" - :was_run: true :content: " # MetricFu.run do |config|" - :was_run: true :content: " # config.base_directory = 'tmp/metric_fu'" - :was_run: true :content: " # end" - :was_run: true :content: " #" - :was_run: true :content: " # See the README for more information on configuration options." - :was_run: true :content: " def self.run" - :was_run: true :content: " yield MetricFu.configuration" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # This does the real work of the Configuration class, by setting" - :was_run: true :content: " # up a bunch of instance variables to represent the configuration" - :was_run: true :content: " # of the MetricFu app." - :was_run: true :content: " def reset" - :was_run: true :content: " @base_directory = ENV['CC_BUILD_ARTIFACTS'] || 'tmp/metric_fu'" - :was_run: true :content: " @scratch_directory = File.join(@base_directory, 'scratch')" - :was_run: true :content: " @output_directory = File.join(@base_directory, 'output')" - :was_run: true :content: " @data_directory = File.join('tmp/metric_fu', '_data')" - :was_run: true :content: " @metric_fu_root_directory = File.join(File.dirname(__FILE__), " - :was_run: true :content: " '..', '..')" - :was_run: true :content: " @template_directory = File.join(@metric_fu_root_directory, " - :was_run: true :content: " 'lib', 'templates') " - :was_run: true :content: " @template_class = AwesomeTemplate" - :was_run: true :content: " set_metrics" - :was_run: true :content: " set_graphs" - :was_run: true :content: " set_code_dirs" - :was_run: true :content: " @flay = { :dirs_to_flay => @code_dirs } " - :was_run: true :content: " @flog = { :dirs_to_flog => @code_dirs }" - :was_run: true :content: " @reek = { :dirs_to_reek => @code_dirs }" - :was_run: true :content: " @roodi = { :dirs_to_roodi => @code_dirs }" - :was_run: true :content: " @saikuro = { :output_directory => @scratch_directory + '/saikuro', " - :was_run: true :content: " :input_directory => @code_dirs," - :was_run: true :content: " :cyclo => \"\"," - :was_run: true :content: " :filter_cyclo => \"0\"," - :was_run: true :content: " :warn_cyclo => \"5\"," - :was_run: true :content: " :error_cyclo => \"7\"," - :was_run: true :content: " :formater => \"text\"}" - :was_run: true :content: " @churn = {}" - :was_run: true :content: " @stats = {}" - :was_run: true :content: " @rcov = { :test_files => ['test/**/*_test.rb', " - :was_run: true :content: " 'spec/**/*_spec.rb']," - :was_run: true :content: " :rcov_opts => [\"--sort coverage\", " - :was_run: true :content: " \"--no-html\", " - :was_run: true :content: " \"--text-coverage\"," - :was_run: true :content: " \"--no-color\"," - :was_run: true :content: " \"--profile\"," - :was_run: true :content: " \"--rails\"," - :was_run: true :content: " \"--exclude /gems/,/Library/,/usr/,spec\"]}" - :was_run: true :content: " " - :was_run: true :content: " @graph_theme = { :colors => %w(orange purple green white red blue pink yellow)," - :was_run: true :content: " :marker_color => 'blue'," - :was_run: true :content: " :background_colors => %w(white white)}" - :was_run: true :content: " " - :was_run: true :content: " relative_font_path = [File.dirname(__FILE__), '..', '..', 'vendor', '_fonts', 'monaco.ttf']" - :was_run: true :content: " @graph_font = File.expand_path(File.join(relative_font_path))" - :was_run: true :content: " @graph_size = \"1000x400\"" - :was_run: true :content: " @graph_title_font_size = 12" - :was_run: true :content: " @graph_legend_box_size = 12" - :was_run: true :content: " @graph_legend_font_size = 10" - :was_run: true :content: " @graph_marker_font_size = 10" - :was_run: true :content: " " - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Perform a simple check to try and guess if we're running" - :was_run: true :content: " # against a rails app." - :was_run: true :content: " #" - :was_run: true :content: " # @todo This should probably be made a bit more robust." - :was_run: true :content: " def rails?" - :was_run: true :content: " @rails = File.exist?(\"config/environment.rb\")" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Add the :stats task to the AVAILABLE_METRICS constant if we're" - :was_run: true :content: " # running within rails." - :was_run: true :content: " def set_metrics" - :was_run: true :content: " if rails?" - :was_run: false :content: " @metrics = MetricFu::AVAILABLE_METRICS + [:stats]" - :was_run: true :content: " else" - :was_run: true :content: " @metrics = MetricFu::AVAILABLE_METRICS" - :was_run: true :content: " end " - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def set_graphs" - :was_run: true :content: " @graphs = MetricFu::AVAILABLE_GRAPHS " - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Add the 'app' directory if we're running within rails." - :was_run: true :content: " def set_code_dirs" - :was_run: true :content: " if rails?" - :was_run: false :content: " @code_dirs = ['app', 'lib']" - :was_run: true :content: " else" - :was_run: true :content: " @code_dirs = ['lib']" - :was_run: true :content: " end" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def platform #:nodoc:" - :was_run: false :content: " return PLATFORM" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def is_cruise_control_rb?" - :was_run: false :content: " ENV['CC_BUILD_ARTIFACTS']" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" :global_percent_run: 49.6 tasks/metric_fu.rake: :percent_run: 18 :lines: - :was_run: true :content: " require 'rake'" - :was_run: true :content: " namespace :metrics do" - :was_run: true :content: " desc \"Generate all metrics reports\"" - :was_run: true :content: " task :all do" - :was_run: false :content: " MetricFu::Configuration.run {}" - :was_run: false :content: " MetricFu.metrics.each {|metric| MetricFu.report.add(metric) }" - :was_run: false :content: " MetricFu.report.save_output(MetricFu.report.to_yaml," - :was_run: false :content: " MetricFu.base_directory, " - :was_run: false :content: " \"report.yml\")" - :was_run: false :content: " MetricFu.report.save_output(MetricFu.report.to_yaml," - :was_run: false :content: " MetricFu.data_directory, " - :was_run: false :content: " \"#{Time.now.strftime(\"%Y%m%d\")}.yml\")" - :was_run: false :content: " MetricFu.report.save_templatized_report" - :was_run: false :content: " " - :was_run: false :content: " MetricFu.graphs.each {|graph| MetricFu.graph.add(graph) }" - :was_run: false :content: " MetricFu.graph.generate" - :was_run: false :content: " " - :was_run: false :content: " if MetricFu.report.open_in_browser?" - :was_run: false :content: " MetricFu.report.show_in_browser(MetricFu.output_directory)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/graphs/flog_grapher.rb: :percent_run: 32 :lines: - :was_run: true :content: " require 'gruff'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class FlogGrapher" - :was_run: true :content: " " - :was_run: true :content: " attr_accessor :flog_total, :flog_average, :labels" - :was_run: true :content: " " - :was_run: true :content: " def initialize" - :was_run: false :content: " self.flog_total = []" - :was_run: false :content: " self.flog_average = []" - :was_run: false :content: " self.labels = {}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_metrics(metrics, date)" - :was_run: false :content: " self.flog_total.push(metrics[:flog][:total])" - :was_run: false :content: " self.flog_average.push(metrics[:flog][:average])" - :was_run: false :content: " self.labels.update( { self.labels.size => date })" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def graph!" - :was_run: false :content: " g = Gruff::Line.new(MetricFu.graph_size)" - :was_run: false :content: " g.title = \"Flog: code complexity\"" - :was_run: false :content: " g.theme = MetricFu.graph_theme" - :was_run: false :content: " g.font = MetricFu.graph_font" - :was_run: false :content: " g.data('flog total', self.flog_total)" - :was_run: false :content: " g.data('flog average', self.flog_average)" - :was_run: false :content: " g.labels = self.labels" - :was_run: false :content: " g.title_font_size = MetricFu.graph_title_font_size" - :was_run: false :content: " g.legend_box_size = MetricFu.graph_legend_box_size" - :was_run: false :content: " g.legend_font_size = MetricFu.graph_legend_font_size" - :was_run: false :content: " g.marker_font_size = MetricFu.graph_marker_font_size" - :was_run: false :content: " g.write(File.join(MetricFu.output_directory, 'flog.png'))" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" lib/base/graph.rb: :percent_run: 38 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " def self.graph" - :was_run: false :content: " @graph ||= Graph.new" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Graph" - :was_run: true :content: " " - :was_run: true :content: " attr_accessor :clazz" - :was_run: true :content: " " - :was_run: true :content: " def initialize" - :was_run: false :content: " self.clazz = []" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def add(graph_type)" - :was_run: false :content: " grapher_name = graph_type.to_s.capitalize + \"Grapher\"" - :was_run: false :content: " self.clazz.push MetricFu.const_get(grapher_name).new" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def generate" - :was_run: false :content: " puts \"Generating graphs\"" - :was_run: false :content: " Dir[File.join(MetricFu.data_directory, '*.yml')].sort.each do |metric_file|" - :was_run: false :content: " puts \"Generating graphs for #{metric_file}\"" - :was_run: false :content: " date = metric_file.split('/')[3].split('.')[0]" - :was_run: false :content: " metrics = YAML::load(File.open(metric_file))" - :was_run: false :content: " " - :was_run: false :content: " self.clazz.each do |grapher|" - :was_run: false :content: " grapher.get_metrics(metrics, date)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " self.clazz.each do |grapher|" - :was_run: false :content: " grapher.graph!" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/graphs/flay_grapher.rb: :percent_run: 35 :lines: - :was_run: true :content: " require 'gruff'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class FlayGrapher" - :was_run: true :content: " " - :was_run: true :content: " attr_accessor :flay_score, :labels" - :was_run: true :content: " " - :was_run: true :content: " def initialize" - :was_run: false :content: " self.flay_score = []" - :was_run: false :content: " self.labels = {}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_metrics(metrics, date)" - :was_run: false :content: " self.flay_score.push(metrics[:flay][:total_score].to_i)" - :was_run: false :content: " self.labels.update( { self.labels.size => date })" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def graph!" - :was_run: false :content: " g = Gruff::Line.new(MetricFu.graph_size)" - :was_run: false :content: " g.title = \"Flay: duplication\"" - :was_run: false :content: " g.theme = MetricFu.graph_theme" - :was_run: false :content: " g.font = MetricFu.graph_font" - :was_run: false :content: " g.data('flay', self.flay_score)" - :was_run: false :content: " g.labels = self.labels" - :was_run: false :content: " g.title_font_size = MetricFu.graph_title_font_size" - :was_run: false :content: " g.legend_box_size = MetricFu.graph_legend_box_size" - :was_run: false :content: " g.legend_font_size = MetricFu.graph_legend_font_size" - :was_run: false :content: " g.marker_font_size = MetricFu.graph_marker_font_size" - :was_run: false :content: " g.write(File.join(MetricFu.output_directory, 'flay.png'))" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" lib/templates/standard/standard_template.rb: :percent_run: 27 :lines: - :was_run: true :content: " class StandardTemplate < MetricFu::Template" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " def write" - :was_run: false :content: " report.each_pair do |section, contents|" - :was_run: false :content: " if template_exists?(section)" - :was_run: false :content: " create_instance_var(section, contents)" - :was_run: false :content: " html = erbify(section)" - :was_run: false :content: " fn = output_filename(section)" - :was_run: false :content: " MetricFu.report.save_output(html, MetricFu.output_directory, fn)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " # Instance variables we need should already be created from above" - :was_run: false :content: " if template_exists?('index')" - :was_run: false :content: " html = erbify('index')" - :was_run: false :content: " fn = output_filename('index')" - :was_run: false :content: " MetricFu.report.save_output(html, MetricFu.output_directory, fn)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def this_directory" - :was_run: false :content: " File.dirname(__FILE__)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " lib/base/md5_tracker.rb: :percent_run: 35 :lines: - :was_run: true :content: " require 'digest/md5'" - :was_run: true :content: " require 'fileutils'" - :was_run: true :content: " " - :was_run: true :content: " module MetricFu" - :was_run: true :content: " class MD5Tracker" - :was_run: true :content: " " - :was_run: true :content: " @@unchanged_md5s = []" - :was_run: true :content: " " - :was_run: true :content: " class << self" - :was_run: true :content: " def md5_dir(path_to_file, base_dir)" - :was_run: false :content: " File.join(base_dir," - :was_run: false :content: " path_to_file.split('/')[0..-2].join('/'))" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def md5_file(path_to_file, base_dir)" - :was_run: false :content: " File.join(md5_dir(path_to_file, base_dir)," - :was_run: false :content: " path_to_file.split('/').last.sub(/\\.[a-z]+/, '.md5'))" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def track(path_to_file, base_dir)" - :was_run: false :content: " md5 = Digest::MD5.hexdigest(File.read(path_to_file))" - :was_run: false :content: " FileUtils.mkdir_p(md5_dir(path_to_file, base_dir), :verbose => false)" - :was_run: false :content: " f = File.new(md5_file(path_to_file, base_dir), \"w\")" - :was_run: false :content: " f.puts(md5)" - :was_run: false :content: " f.close" - :was_run: false :content: " md5" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def file_changed?(path_to_file, base_dir)" - :was_run: false :content: " orig_md5_file = md5_file(path_to_file, base_dir)" - :was_run: false :content: " return track(path_to_file, base_dir) unless File.exist?(orig_md5_file)" - :was_run: false :content: " " - :was_run: false :content: " current_md5 = \"\"" - :was_run: false :content: " file = File.open(orig_md5_file, 'r')" - :was_run: false :content: " file.each_line { |line| current_md5 << line }" - :was_run: false :content: " file.close" - :was_run: false :content: " current_md5.chomp!" - :was_run: false :content: " " - :was_run: false :content: " new_md5 = Digest::MD5.hexdigest(File.read(path_to_file))" - :was_run: false :content: " new_md5.chomp!" - :was_run: false :content: " " - :was_run: false :content: " @@unchanged_md5s << path_to_file if new_md5 == current_md5" - :was_run: false :content: " " - :was_run: false :content: " return new_md5 != current_md5" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def file_already_counted?(path_to_file)" - :was_run: false :content: " return @@unchanged_md5s.include?(path_to_file)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/generators/flog.rb: :percent_run: 38 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class Flog < Generator" - :was_run: true :content: " attr_reader :pages" - :was_run: true :content: " " - :was_run: true :content: " def self.verify_dependencies!" - :was_run: false :content: " `flog --help`" - :was_run: false :content: " raise 'sudo gem install flog # if you want the flog tasks' unless $?.success?" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " SCORE_FORMAT = \"%0.2f\"" - :was_run: true :content: " METHOD_LINE_REGEX = /(\\d+\\.\\d+):\\s+([A-Za-z:]+#.*)/" - :was_run: true :content: " OPERATOR_LINE_REGEX = /\\s*(\\d+\\.\\d+):\\s(.*)$/" - :was_run: true :content: " " - :was_run: true :content: " def emit" - :was_run: true :content: " metric_dir = MetricFu::Flog.metric_directory" - :was_run: true :content: " MetricFu.flog[:dirs_to_flog].each do |directory|" - :was_run: true :content: " Dir.glob(\"#{directory}/**/*.rb\").each do |filename|" - :was_run: true :content: " output_dir = \"#{metric_dir}/#{filename.split(\"/\")[0..-2].join(\"/\")}\"" - :was_run: false :content: " mkdir_p(output_dir, :verbose => false) unless File.directory?(output_dir)" - :was_run: false :content: " if MetricFu::MD5Tracker.file_changed?(filename, metric_dir)" - :was_run: false :content: " `flog -ad #{filename} > #{metric_dir}/#{filename.split('.')[0]}.txt`" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " rescue LoadError" - :was_run: false :content: " if RUBY_PLATFORM =~ /java/" - :was_run: false :content: " puts 'running in jruby - flog tasks not available'" - :was_run: false :content: " else" - :was_run: false :content: " puts 'sudo gem install flog # if you want the flog tasks'" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def parse(text)" - :was_run: false :content: " summary, methods_summary = text.split \"\\n\\n\"" - :was_run: false :content: " return unless summary" - :was_run: false :content: " score, average = summary.split(\"\\n\").map {|line| line[OPERATOR_LINE_REGEX, 1]}" - :was_run: false :content: " return nil unless score && methods_summary" - :was_run: false :content: " page = Flog::Page.new(score, average)" - :was_run: false :content: " methods_summary.each_line do |method_line|" - :was_run: false :content: " if match = method_line.match(METHOD_LINE_REGEX)" - :was_run: false :content: " page.scanned_methods << ScannedMethod.new(match[2], match[1])" - :was_run: false :content: " elsif match = method_line.match(OPERATOR_LINE_REGEX)" - :was_run: false :content: " return if page.scanned_methods.empty?" - :was_run: false :content: " page.scanned_methods.last.operators << Operator.new(match[1], match[2])" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " page" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze" - :was_run: false :content: " @pages = []" - :was_run: false :content: " flog_results.each do |path|" - :was_run: false :content: " page = parse(open(path, \"r\") { |f| f.read })" - :was_run: false :content: " if page" - :was_run: false :content: " page.path = path.sub(metric_directory, \"\").sub(\".txt\", \".rb\") " - :was_run: false :content: " @pages << page" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " number_of_methods = @pages.inject(0) {|count, page| count += page.scanned_methods.size}" - :was_run: false :content: " total_flog_score = @pages.inject(0) {|total, page| total += page.score}" - :was_run: false :content: " sorted_pages = @pages.sort_by {|page| page.score }.reverse " - :was_run: false :content: " {:flog => { :total => total_flog_score," - :was_run: false :content: " :average => average_score(total_flog_score, number_of_methods)," - :was_run: false :content: " :pages => sorted_pages.map {|page| page.to_h}}}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " private" - :was_run: true :content: " " - :was_run: true :content: " def average_score(total_flog_score, number_of_methods)" - :was_run: false :content: " return 0 if total_flog_score == 0" - :was_run: false :content: " round_to_tenths(total_flog_score/number_of_methods)" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def flog_results" - :was_run: false :content: " Dir.glob(\"#{metric_directory}/**/*.txt\")" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Operator" - :was_run: true :content: " attr_accessor :score, :operator" - :was_run: true :content: " " - :was_run: true :content: " def initialize(score, operator)" - :was_run: false :content: " @score = score.to_f" - :was_run: false :content: " @operator = operator" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:score => @score, :operator => @operator}" - :was_run: false :content: " end" - :was_run: false :content: " end " - :was_run: true :content: " " - :was_run: true :content: " class ScannedMethod" - :was_run: true :content: " attr_accessor :name, :score, :operators" - :was_run: true :content: " " - :was_run: true :content: " def initialize(name, score, operators = [])" - :was_run: false :content: " @name = name" - :was_run: false :content: " @score = score.to_f" - :was_run: false :content: " @operators = operators" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:name => @name," - :was_run: false :content: " :score => @score," - :was_run: false :content: " :operators => @operators.map {|o| o.to_h}}" - :was_run: false :content: " end" - :was_run: false :content: " end " - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " class Flog::Page < MetricFu::Generator" - :was_run: true :content: " attr_accessor :path, :score, :scanned_methods, :average_score" - :was_run: true :content: " " - :was_run: true :content: " def initialize(score, average_score, scanned_methods = [])" - :was_run: false :content: " @score = score.to_f" - :was_run: false :content: " @scanned_methods = scanned_methods" - :was_run: false :content: " @average_score = average_score.to_f" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def filename " - :was_run: false :content: " File.basename(path, \".txt\") " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_h" - :was_run: false :content: " {:score => @score, " - :was_run: false :content: " :scanned_methods => @scanned_methods.map {|sm| sm.to_h}," - :was_run: false :content: " :highest_score => highest_score," - :was_run: false :content: " :average_score => average_score," - :was_run: false :content: " :path => path}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def highest_score" - :was_run: false :content: " scanned_methods.inject(0) do |highest, m|" - :was_run: false :content: " m.score > highest ? m.score : highest" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end " - :was_run: false :content: " end" lib/base/generator.rb: :percent_run: 70 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " # = Generator" - :was_run: true :content: " #" - :was_run: true :content: " # The Generator class is an abstract class that provides the " - :was_run: true :content: " # skeleton for producing different types of metrics." - :was_run: true :content: " #" - :was_run: true :content: " # It drives the production of the metrics through a template " - :was_run: true :content: " # method - #generate_report(options={}). This method calls" - :was_run: true :content: " # #emit, #analyze and #to_h in order to produce the metrics." - :was_run: true :content: " #" - :was_run: true :content: " # To implement a concrete class to generate a metric, therefore," - :was_run: true :content: " # the class must implement those three methods. " - :was_run: true :content: " #" - :was_run: true :content: " # * #emit should take care of running the metric tool and " - :was_run: true :content: " # gathering its output. " - :was_run: true :content: " # * #analyze should take care of manipulating the output from" - :was_run: true :content: " # #emit and making it possible to store it in a programmatic way." - :was_run: true :content: " # * #to_h should provide a hash representation of the output from" - :was_run: true :content: " # #analyze ready to be serialized into yaml at some point." - :was_run: true :content: " #" - :was_run: true :content: " # == Pre-conditions" - :was_run: true :content: " #" - :was_run: true :content: " # Based on the class name of the concrete class implementing a" - :was_run: true :content: " # Generator, the Generator class will create a 'metric_directory'" - :was_run: true :content: " # named after the class under the MetricFu.scratch_directory, where" - :was_run: true :content: " # any output from the #emit method should go." - :was_run: true :content: " #" - :was_run: true :content: " # It will also create the MetricFu.output_directory if neccessary, and" - :was_run: true :content: " # in general setup the directory structure that the MetricFu system" - :was_run: true :content: " # expects." - :was_run: true :content: " class Generator" - :was_run: true :content: " attr_reader :report, :template" - :was_run: true :content: " " - :was_run: true :content: " def initialize(options={})" - :was_run: false :content: " self.class.verify_dependencies!" - :was_run: false :content: " create_metric_dir_if_missing" - :was_run: false :content: " create_output_dir_if_missing" - :was_run: false :content: " create_data_dir_if_missing" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Creates a new generator and returns the output of the " - :was_run: true :content: " # #generate_report method. This is the typical way to " - :was_run: true :content: " # generate a new MetricFu report. For more information see" - :was_run: true :content: " # the #generate_report instance method." - :was_run: true :content: " #" - :was_run: true :content: " # @params options Hash" - :was_run: true :content: " # A currently unused hash to configure the Generator" - :was_run: true :content: " #" - :was_run: true :content: " # @see generate_report" - :was_run: true :content: " def self.generate_report(options={})" - :was_run: false :content: " generator = self.new(options)" - :was_run: false :content: " generator.generate_report" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Provides the unqualified class name of an implemented concrete" - :was_run: true :content: " # class, as a string. For example:" - :was_run: true :content: " #" - :was_run: true :content: " # class Flay < Generator; end" - :was_run: true :content: " # klass = Flay.new" - :was_run: true :content: " # klass.class_name" - :was_run: true :content: " # > \"flay\"" - :was_run: true :content: " #" - :was_run: true :content: " # @return String" - :was_run: true :content: " # The unqualified class name of this concrete class, returned" - :was_run: true :content: " # as a string." - :was_run: true :content: " def self.class_name" - :was_run: false :content: " self.to_s.split('::').last.downcase" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Returns the directory where the Generator will write any output" - :was_run: true :content: " def self.metric_directory" - :was_run: false :content: " File.join(MetricFu.scratch_directory, class_name) " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def create_metric_dir_if_missing #:nodoc:" - :was_run: false :content: " unless File.directory?(metric_directory)" - :was_run: false :content: " FileUtils.mkdir_p(metric_directory, :verbose => false) " - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def create_output_dir_if_missing #:nodoc:" - :was_run: false :content: " unless File.directory?(MetricFu.output_directory)" - :was_run: false :content: " FileUtils.mkdir_p(MetricFu.output_directory, :verbose => false) " - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def create_data_dir_if_missing #:nodoc:" - :was_run: false :content: " unless File.directory?(MetricFu.data_directory)" - :was_run: false :content: " FileUtils.mkdir_p(MetricFu.data_directory, :verbose => false) " - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # @return String" - :was_run: true :content: " # The path of the metric directory this class is using." - :was_run: true :content: " def metric_directory" - :was_run: false :content: " self.class.metric_directory" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " " - :was_run: true :content: " # Defines some hook methods for the concrete classes to hook into." - :was_run: true :content: " %w[emit analyze].each do |meth|" - :was_run: true :content: " define_method(\"before_#{meth}\".to_sym) {}" - :was_run: true :content: " define_method(\"after_#{meth}\".to_sym) {}" - :was_run: true :content: " end" - :was_run: true :content: " define_method(\"before_to_h\".to_sym) {}" - :was_run: true :content: " " - :was_run: true :content: " # Provides a template method to drive the production of a metric" - :was_run: true :content: " # from a concrete implementation of this class. Each concrete" - :was_run: true :content: " # class must implement the three methods that this template method" - :was_run: true :content: " # calls: #emit, #analyze and #to_h. For more details, see the" - :was_run: true :content: " # class documentation." - :was_run: true :content: " #" - :was_run: true :content: " # This template method also calls before_emit, after_emit... etc." - :was_run: true :content: " # methods to allow extra hooks into the processing methods, and help" - :was_run: true :content: " # to keep the logic of your Generators clean." - :was_run: true :content: " def generate_report" - :was_run: true :content: " %w[emit analyze].each do |meth|" - :was_run: true :content: " send(\"before_#{meth}\".to_sym)" - :was_run: true :content: " send(\"#{meth}\".to_sym)" - :was_run: true :content: " send(\"after_#{meth}\".to_sym)" - :was_run: true :content: " end" - :was_run: true :content: " before_to_h()" - :was_run: true :content: " to_h()" - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def round_to_tenths(decimal)" - :was_run: true :content: " (decimal * 10).round / 10.0 " - :was_run: true :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Allows subclasses to check for required gems" - :was_run: true :content: " def self.verify_dependencies!" - :was_run: false :content: " true" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def emit #:nodoc:" - :was_run: false :content: " raise <<-EOF" - :was_run: false :content: " This method must be implemented by a concrete class descending" - :was_run: false :content: " from Generator. See generator class documentation for more " - :was_run: false :content: " information." - :was_run: false :content: " EOF" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def analyze #:nodoc:" - :was_run: false :content: " raise <<-EOF" - :was_run: false :content: " This method must be implemented by a concrete class descending" - :was_run: false :content: " from Generator. See generator class documentation for more " - :was_run: false :content: " information." - :was_run: false :content: " EOF" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def to_graph #:nodoc:" - :was_run: false :content: " raise <<-EOF" - :was_run: false :content: " This method must be implemented by a concrete class descending" - :was_run: false :content: " from Generator. See generator class documentation for more " - :was_run: false :content: " information." - :was_run: false :content: " EOF" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " end" lib/templates/awesome/awesome_template.rb: :percent_run: 20 :lines: - :was_run: true :content: " class AwesomeTemplate < MetricFu::Template" - :was_run: true :content: " " - :was_run: true :content: " def write" - :was_run: false :content: " # Getting rid of the crap before and after the project name from integrity" - :was_run: false :content: " @name = File.basename(MetricFu.run_dir).gsub(/^\\w+-|-\\w+$/, \"\")" - :was_run: false :content: " " - :was_run: false :content: " report.each_pair do |section, contents|" - :was_run: false :content: " if template_exists?(section)" - :was_run: false :content: " create_instance_var(section, contents)" - :was_run: false :content: " @html = erbify(section)" - :was_run: false :content: " html = erbify('layout')" - :was_run: false :content: " fn = output_filename(section)" - :was_run: false :content: " MetricFu.report.save_output(html, MetricFu.output_directory, fn)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " # Instance variables we need should already be created from above" - :was_run: false :content: " if template_exists?('index')" - :was_run: false :content: " @html = erbify('index')" - :was_run: false :content: " html = erbify('layout')" - :was_run: false :content: " fn = output_filename('index')" - :was_run: false :content: " MetricFu.report.save_output(html, MetricFu.output_directory, fn)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def this_directory" - :was_run: false :content: " File.dirname(__FILE__)" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " lib/graphs/rcov_grapher.rb: :percent_run: 35 :lines: - :was_run: true :content: " require 'gruff'" - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " class RcovGrapher" - :was_run: true :content: " " - :was_run: true :content: " attr_accessor :rcov_percent, :labels" - :was_run: true :content: " " - :was_run: true :content: " def initialize" - :was_run: false :content: " self.rcov_percent = []" - :was_run: false :content: " self.labels = {}" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def get_metrics(metrics, date)" - :was_run: false :content: " self.rcov_percent.push(metrics[:rcov][:global_percent_run])" - :was_run: false :content: " self.labels.update( { self.labels.size => date })" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def graph!" - :was_run: false :content: " g = Gruff::Line.new(MetricFu.graph_size)" - :was_run: false :content: " g.title = \"Rcov: code coverage\"" - :was_run: false :content: " g.theme = MetricFu.graph_theme" - :was_run: false :content: " g.font = MetricFu.graph_font" - :was_run: false :content: " g.data('rcov', self.rcov_percent)" - :was_run: false :content: " g.labels = self.labels" - :was_run: false :content: " g.title_font_size = MetricFu.graph_title_font_size" - :was_run: false :content: " g.legend_box_size = MetricFu.graph_legend_box_size" - :was_run: false :content: " g.legend_font_size = MetricFu.graph_legend_font_size" - :was_run: false :content: " g.marker_font_size = MetricFu.graph_marker_font_size" - :was_run: false :content: " g.write(File.join(MetricFu.output_directory, 'rcov.png'))" - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " " - :was_run: false :content: " end" lib/base/base_template.rb: :percent_run: 74 :lines: - :was_run: true :content: " module MetricFu" - :was_run: true :content: " " - :was_run: true :content: " # The Template class is intended as an abstract class for concrete" - :was_run: true :content: " # template classes to subclass. It provides a variety of utility" - :was_run: true :content: " # methods to make templating a bit easier. However, classes do not" - :was_run: true :content: " # have to inherit from here in order to provide a template. The only" - :was_run: true :content: " # requirement for a template class is that it provides a #write method" - :was_run: true :content: " # to actually write out the template. See StandardTemplate for an" - :was_run: true :content: " # example." - :was_run: true :content: " class Template" - :was_run: true :content: " attr_accessor :report" - :was_run: true :content: " " - :was_run: true :content: " private" - :was_run: true :content: " # Creates a new erb evaluated result from the passed in section." - :was_run: true :content: " #" - :was_run: true :content: " # @param section String" - :was_run: true :content: " # The section name of " - :was_run: true :content: " #" - :was_run: true :content: " # @return String" - :was_run: true :content: " # The erb evaluated string" - :was_run: true :content: " def erbify(section)" - :was_run: false :content: " require 'erb'" - :was_run: false :content: " erb_doc = File.read(template(section))" - :was_run: false :content: " ERB.new(erb_doc).result(binding)" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Determines whether a template file exists for a given section" - :was_run: true :content: " # of the full template." - :was_run: true :content: " #" - :was_run: true :content: " # @param section String" - :was_run: true :content: " # The section of the template to check against" - :was_run: true :content: " #" - :was_run: true :content: " # @return Boolean" - :was_run: true :content: " # Does a template file exist for this section or not?" - :was_run: true :content: " def template_exists?(section)" - :was_run: false :content: " File.exist?(template(section))" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Copies an instance variable mimicing the name of the section" - :was_run: true :content: " # we are trying to render, with a value equal to the passed in " - :was_run: true :content: " # constant. Allows the concrete template classes to refer to " - :was_run: true :content: " # that instance variable from their ERB rendering" - :was_run: true :content: " #" - :was_run: true :content: " # @param section String" - :was_run: true :content: " # The name of the instance variable to create" - :was_run: true :content: " #" - :was_run: true :content: " # @param contents Object" - :was_run: true :content: " # The value to set as the value of the created instance" - :was_run: true :content: " # variable" - :was_run: true :content: " def create_instance_var(section, contents)" - :was_run: false :content: " instance_variable_set(\"@#{section}\", contents) " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Generates the filename of the template file to load and " - :was_run: true :content: " # evaluate. In this case, the path to the template directory +" - :was_run: true :content: " # the section name + .html.erb" - :was_run: true :content: " #" - :was_run: true :content: " # @param section String" - :was_run: true :content: " # A section of the template to render" - :was_run: true :content: " #" - :was_run: true :content: " # @return String" - :was_run: true :content: " # A file path" - :was_run: true :content: " def template(section)" - :was_run: false :content: " File.join(this_directory, section.to_s + \".html.erb\")" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Returns the filename that the template will render into for" - :was_run: true :content: " # a given section. In this case, the section name + '.html'" - :was_run: true :content: " #" - :was_run: true :content: " # @param section String" - :was_run: true :content: " # A section of the template to render" - :was_run: true :content: " #" - :was_run: true :content: " # @return String" - :was_run: true :content: " # The output filename" - :was_run: true :content: " def output_filename(section)" - :was_run: false :content: " section.to_s + \".html\"" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Returns the contents of a given css file in order to " - :was_run: true :content: " # render it inline into a template." - :was_run: true :content: " #" - :was_run: true :content: " # @param css String" - :was_run: true :content: " # The name of a css file to open" - :was_run: true :content: " #" - :was_run: true :content: " # @return String" - :was_run: true :content: " # The contents of the css file" - :was_run: true :content: " def inline_css(css)" - :was_run: false :content: " open(File.join(this_directory, css)) { |f| f.read } " - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Provides a link to open a file through the textmate protocol" - :was_run: true :content: " # on Darwin, or otherwise, a simple file link." - :was_run: true :content: " #" - :was_run: true :content: " # @param name String" - :was_run: true :content: " # " - :was_run: true :content: " # @param line Integer" - :was_run: true :content: " # The line number to link to, if textmate is available. Defaults" - :was_run: true :content: " # to nil" - :was_run: true :content: " #" - :was_run: true :content: " # @return String" - :was_run: true :content: " # An anchor link to a textmate reference or a file reference" - :was_run: true :content: " def link_to_filename(name, line = nil, link_content = nil)" - :was_run: false :content: " \"#{link_content(name, line, link_content)}\"" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def link_content(name, line=nil, link_content=nil) # :nodoc:" - :was_run: false :content: " if link_content" - :was_run: false :content: " link_content" - :was_run: false :content: " elsif line" - :was_run: false :content: " \"#{name}:#{line}\"" - :was_run: false :content: " else" - :was_run: false :content: " name" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " def file_url(name, line) # :nodoc:" - :was_run: false :content: " filename = File.expand_path(name.gsub(/^\\//, ''))" - :was_run: false :content: " if MetricFu.configuration.platform.include?('darwin')" - :was_run: false :content: " \"txmt://open/?url=file://#{filename}\" << (line ? \"&line=#{line}\" : \"\")" - :was_run: false :content: " else " - :was_run: false :content: " \"file://#{filename}\"" - :was_run: false :content: " end" - :was_run: false :content: " end" - :was_run: true :content: " " - :was_run: true :content: " # Provides a brain dead way to cycle between two values during" - :was_run: true :content: " # an iteration of some sort. Pass in the first_value, the second_value," - :was_run: true :content: " # and the cardinality of the iteration." - :was_run: true :content: " #" - :was_run: true :content: " # @param first_value Object" - :was_run: true :content: " #" - :was_run: true :content: " # @param second_value Object" - :was_run: true :content: " #" - :was_run: true :content: " # @param iteration Integer" - :was_run: true :content: " # The number of times through the iteration." - :was_run: true :content: " #" - :was_run: true :content: " # @return Object" - :was_run: true :content: " # The first_value if iteration is even. The second_value if" - :was_run: true :content: " # iteration is odd." - :was_run: true :content: " def cycle(first_value, second_value, iteration)" - :was_run: false :content: " return first_value if iteration % 2 == 0" - :was_run: false :content: " return second_value" - :was_run: false :content: " end " - :was_run: false :content: " " - :was_run: false :content: " " - :was_run: false :content: " end" - :was_run: false :content: " end" lib/metric_fu.rb: :percent_run: 100 :lines: - :was_run: true :content: " # Load a few things to make our lives easier elsewhere." - :was_run: true :content: " module MetricFu" - :was_run: true :content: " LIB_ROOT = File.dirname(__FILE__)" - :was_run: true :content: " end" - :was_run: true :content: " base_dir = File.join(MetricFu::LIB_ROOT, 'base')" - :was_run: true :content: " generator_dir = File.join(MetricFu::LIB_ROOT, 'generators')" - :was_run: true :content: " template_dir = File.join(MetricFu::LIB_ROOT, 'templates')" - :was_run: true :content: " graph_dir = File.join(MetricFu::LIB_ROOT, 'graphs')" - :was_run: true :content: " " - :was_run: true :content: " # We need to require these two things first because our other classes" - :was_run: true :content: " # depend on them." - :was_run: true :content: " require File.join(base_dir, 'report') " - :was_run: true :content: " require File.join(base_dir, 'generator')" - :was_run: true :content: " require File.join(base_dir, 'graph')" - :was_run: true :content: " " - :was_run: true :content: " # Load the rakefile so users of the gem get the default metric_fu task" - :was_run: true :content: " load File.join(MetricFu::LIB_ROOT, '..', 'tasks', 'metric_fu.rake')" - :was_run: true :content: " " - :was_run: true :content: " # Now load everything else that's in the directory" - :was_run: true :content: " Dir[File.join(base_dir, '*.rb')].each{|l| require l }" - :was_run: true :content: " Dir[File.join(generator_dir, '*.rb')].each {|l| require l }" - :was_run: true :content: " Dir[File.join(template_dir, 'standard/*.rb')].each {|l| require l}" - :was_run: true :content: " Dir[File.join(template_dir, 'awesome/*.rb')].each {|l| require l}" - :was_run: true :content: " Dir[File.join(graph_dir, '*.rb')].each {|l| require l}" :reek: :matches: - :code_smells: - :type: Utility Function :method: MetricFu::Template#cycle :message: doesn't depend on instance state - :type: Feature Envy :method: MetricFu::Template#cycle :message: refers to iteration more than self - :type: Utility Function :method: MetricFu::Template#file_url :message: doesn't depend on instance state - :type: Control Couple :method: MetricFu::Template#file_url :message: is controlled by argument line - :type: Feature Envy :method: MetricFu::Template#file_url :message: refers to name more than self - :type: Uncommunicative Name :method: MetricFu::Template#inline_css/block :message: has the variable name 'f' - :type: Control Couple :method: MetricFu::Template#link_content :message: is controlled by argument line - :type: Control Couple :method: MetricFu::Template#link_content :message: is controlled by argument link_content - :type: Utility Function :method: MetricFu::Template#output_filename :message: doesn't depend on instance state - :type: Feature Envy :method: MetricFu::Template#output_filename :message: refers to section more than self :file_path: lib/base/base_template.rb - :code_smells: - :type: Large Class :method: MetricFu::Configuration :message: has at least 26 instance variables - :type: Utility Function :method: MetricFu::Configuration#is_cruise_control_rb? :message: doesn't depend on instance state - :type: Duplication :method: MetricFu::Configuration#reset :message: calls File.dirname("lib/base/configuration.rb") multiple times - :type: Long Method :method: MetricFu::Configuration#reset :message: has approx 26 statements :file_path: lib/base/configuration.rb - :code_smells: - :type: Nested Iterators :method: MetricFu::Generator#block/block :message: is nested - :type: Duplication :method: MetricFu::Generator#create_data_dir_if_missing :message: calls MetricFu.data_directory multiple times - :type: Utility Function :method: MetricFu::Generator#create_data_dir_if_missing :message: doesn't depend on instance state - :type: Duplication :method: MetricFu::Generator#create_metric_dir_if_missing :message: calls metric_directory multiple times - :type: Duplication :method: MetricFu::Generator#create_output_dir_if_missing :message: calls MetricFu.output_directory multiple times - :type: Utility Function :method: MetricFu::Generator#create_output_dir_if_missing :message: doesn't depend on instance state - :type: Long Method :method: MetricFu::Generator#generate_report :message: has approx 6 statements - :type: Utility Function :method: MetricFu::Generator#round_to_tenths :message: doesn't depend on instance state - :type: Feature Envy :method: MetricFu::Generator#round_to_tenths :message: refers to decimal more than self :file_path: lib/base/generator.rb - :code_smells: - :type: Duplication :method: MetricFu::Graph#generate :message: calls self.clazz multiple times - :type: Duplication :method: MetricFu::Graph#generate :message: calls self.clazz.each multiple times - :type: Long Method :method: MetricFu::Graph#generate :message: has approx 7 statements - :type: Nested Iterators :method: MetricFu::Graph#generate/block/block :message: is nested :file_path: lib/base/graph.rb - :code_smells: - :type: Utility Function :method: MetricFu::MD5Tracker#file_already_counted? :message: doesn't depend on instance state - :type: Duplication :method: MetricFu::MD5Tracker#file_changed? :message: calls (new_md5 == current_md5) multiple times - :type: Long Method :method: MetricFu::MD5Tracker#file_changed? :message: has approx 11 statements - :type: Feature Envy :method: MetricFu::MD5Tracker#file_changed? :message: refers to new_md5 more than self - :type: Utility Function :method: MetricFu::MD5Tracker#md5_dir :message: doesn't depend on instance state - :type: Feature Envy :method: MetricFu::MD5Tracker#md5_dir :message: refers to path_to_file more than self - :type: Long Method :method: MetricFu::MD5Tracker#track :message: has approx 6 statements - :type: Uncommunicative Name :method: MetricFu::MD5Tracker#track :message: has the variable name 'f' :file_path: lib/base/md5_tracker.rb - :code_smells: - :type: Duplication :method: MetricFu::Report#open_in_browser? :message: calls MetricFu.configuration multiple times - :type: Utility Function :method: MetricFu::Report#open_in_browser? :message: doesn't depend on instance state - :type: Uncommunicative Name :method: MetricFu::Report#save_output/block :message: has the variable name 'f' :file_path: lib/base/report.rb - :code_smells: - :type: Utility Function :method: MetricFu::Churn#Svn#clean_up_svn_line :message: doesn't depend on instance state - :type: Uncommunicative Name :method: MetricFu::Churn#Svn#clean_up_svn_line :message: has the variable name 'm' - :type: Feature Envy :method: MetricFu::Churn#Svn#clean_up_svn_line :message: refers to line more than self - :type: Feature Envy :method: MetricFu::Churn#Svn#clean_up_svn_line :message: refers to m more than self - :type: Uncommunicative Name :method: MetricFu::Churn#analyze/block :message: has the variable name 'x' - :type: Uncommunicative Name :method: MetricFu::Churn#analyze/block :message: has the variable name 'y' - :type: Duplication :method: MetricFu::Churn#initialize :message: calls MetricFu.churn multiple times - :type: Duplication :method: MetricFu::Churn#initialize :message: calls MetricFu.churn[:start_date] multiple times - :type: Feature Envy :method: MetricFu::Churn#parse_log_for_changes :message: refers to changes more than self :file_path: lib/generators/churn.rb - :code_smells: - :type: Uncommunicative Name :method: MetricFu::Flay#analyze/block :message: has the variable name 'm' - :type: Long Method :method: MetricFu::Flay#to_h :message: has approx 9 statements - :type: Nested Iterators :method: MetricFu::Flay#to_h/block/block :message: is nested :file_path: lib/generators/flay.rb - :code_smells: - :type: Uncommunicative Name :method: MetricFu::Flog#ScannedMethod#to_h/block :message: has the variable name 'o' - :type: Long Method :method: MetricFu::Flog#analyze :message: has approx 6 statements - :type: Uncommunicative Name :method: MetricFu::Flog#analyze/block/block :message: has the variable name 'f' - :type: Nested Iterators :method: MetricFu::Flog#analyze/block/block :message: is nested - :type: Feature Envy :method: MetricFu::Flog#average_score :message: refers to total_flog_score more than self - :type: Long Method :method: MetricFu::Flog#emit :message: has approx 6 statements - :type: Nested Iterators :method: MetricFu::Flog#emit/block/block :message: is nested - :type: Duplication :method: MetricFu::Flog#parse :message: calls match[1] multiple times - :type: Duplication :method: MetricFu::Flog#parse :message: calls match[2] multiple times - :type: Duplication :method: MetricFu::Flog#parse :message: calls page.scanned_methods multiple times - :type: Utility Function :method: MetricFu::Flog#parse :message: doesn't depend on instance state - :type: Long Method :method: MetricFu::Flog#parse :message: has approx 9 statements - :type: Feature Envy :method: MetricFu::Flog#parse :message: refers to match more than self - :type: Duplication :method: MetricFu::Flog#to_h :message: calls @pages.inject(0) multiple times - :type: Duplication :method: MetricFu::Flog#to_h :message: calls page.score multiple times - :type: Duplication :method: MetricFu::Flog::Page#highest_score :message: calls m.score multiple times - :type: Feature Envy :method: MetricFu::Flog::Page#highest_score :message: refers to m more than self - :type: Uncommunicative Name :method: MetricFu::Flog::Page#highest_score/block :message: has the variable name 'm' :file_path: lib/generators/flog.rb - :code_smells: - :type: Duplication :method: MetricFu::Rcov#analyze :message: calls files.each_pair multiple times - :type: Long Method :method: MetricFu::Rcov#analyze :message: has approx 18 statements - :type: Nested Iterators :method: MetricFu::Rcov#analyze/block/block :message: is nested - :type: Duplication :method: MetricFu::Rcov#emit :message: calls MetricFu.rcov multiple times - :type: Duplication :method: MetricFu::Rcov#emit :message: calls MetricFu::Rcov.metric_directory multiple times - :type: Long Method :method: MetricFu::Rcov#emit :message: has approx 7 statements :file_path: lib/generators/rcov.rb - :code_smells: - :type: Long Method :method: MetricFu::Reek#analyze :message: has approx 9 statements - :type: Uncommunicative Name :method: MetricFu::Reek#analyze/block :message: has the variable name 'm' - :type: Nested Iterators :method: MetricFu::Reek#analyze/block/block :message: is nested :file_path: lib/generators/reek.rb - :code_smells: - :type: Long Method :method: MetricFu::Roodi#analyze :message: has approx 8 statements - :type: Uncommunicative Name :method: MetricFu::Roodi#analyze/block :message: has the variable name 'm' :file_path: lib/generators/roodi.rb - :code_smells: - :type: Duplication :method: MetricFu::Saikuro#analyze :message: calls @files.each multiple times - :type: Duplication :method: MetricFu::Saikuro#analyze :message: calls f.elements multiple times - :type: Long Method :method: MetricFu::Saikuro#analyze :message: has approx 17 statements - :type: Uncommunicative Name :method: MetricFu::Saikuro#analyze/block :message: has the variable name 'f' - :type: Uncommunicative Name :method: MetricFu::Saikuro#analyze/block :message: has the variable name 'k' - :type: Uncommunicative Name :method: MetricFu::Saikuro#analyze/block/block :message: has the variable name 'a' - :type: Uncommunicative Name :method: MetricFu::Saikuro#analyze/block/block :message: has the variable name 'b' - :type: Nested Iterators :method: MetricFu::Saikuro#analyze/block/block :message: is nested - :type: Nested Iterators :method: MetricFu::Saikuro#analyze/block/block/block :message: is nested - :type: Duplication :method: MetricFu::Saikuro#emit :message: calls MetricFu.saikuro multiple times - :type: Long Method :method: MetricFu::Saikuro#emit :message: has approx 7 statements - :type: Control Couple :method: MetricFu::Saikuro#emit/block :message: is controlled by argument ok - :type: Utility Function :method: MetricFu::Saikuro#format_directories :message: doesn't depend on instance state - :type: Uncommunicative Name :method: MetricFu::Saikuro#to_h/block :message: has the variable name 'c' - :type: Uncommunicative Name :method: MetricFu::Saikuro#to_h/block :message: has the variable name 'm' - :type: Long Method :method: MetricFu::Saikuro::ParsingElement#to_h :message: has approx 8 statements - :type: Duplication :method: MetricFu::Saikuro::SFile#get_class_names :message: calls element.name multiple times - :type: Feature Envy :method: MetricFu::Saikuro::SFile#get_class_names :message: refers to class_names more than self - :type: Feature Envy :method: MetricFu::Saikuro::SFile#get_class_names :message: refers to element more than self - :type: Duplication :method: MetricFu::Saikuro::SFile#get_elements :message: calls (@elements << element) multiple times - :type: Duplication :method: MetricFu::Saikuro::SFile#get_elements :message: calls @file_handle.readline multiple times - :type: Duplication :method: MetricFu::Saikuro::SFile#get_elements :message: calls element.nil? multiple times - :type: Long Method :method: MetricFu::Saikuro::SFile#get_elements :message: has approx 11 statements - :type: Long Method :method: MetricFu::Saikuro::SFile#merge_classes :message: has approx 14 statements - :type: Feature Envy :method: MetricFu::Saikuro::SFile#merge_classes :message: refers to el more than self - :type: Uncommunicative Name :method: MetricFu::Saikuro::SFile#merge_classes/block/block :message: has the variable name 'd' - :type: Uncommunicative Name :method: MetricFu::Saikuro::SFile#merge_classes/block/block :message: has the variable name 'x' - :type: Nested Iterators :method: MetricFu::Saikuro::SFile#merge_classes/block/block :message: is nested - :type: Uncommunicative Name :method: MetricFu::Saikuro::SFile#self.is_valid_text_file?/block :message: has the variable name 'f' :file_path: lib/generators/saikuro.rb - :code_smells: - :type: Duplication :method: MetricFu::Stats#analyze :message: calls el.empty? multiple times - :type: Duplication :method: MetricFu::Stats#analyze :message: calls elements.map! multiple times - :type: Duplication :method: MetricFu::Stats#analyze :message: calls elements.shift multiple times - :type: Duplication :method: MetricFu::Stats#analyze :message: calls line[0] multiple times - :type: Duplication :method: MetricFu::Stats#analyze :message: calls line[0].chr multiple times - :type: Duplication :method: MetricFu::Stats#analyze :message: calls output.find_all multiple times - :type: Long Method :method: MetricFu::Stats#analyze :message: has approx 21 statements - :type: Nested Iterators :method: MetricFu::Stats#analyze/block/block :message: is nested :file_path: lib/generators/stats.rb - :code_smells: - :type: Duplication :method: MetricFu::FlayGrapher#get_metrics :message: calls self.labels multiple times - :type: Long Method :method: MetricFu::FlayGrapher#graph! :message: has approx 11 statements - :type: Uncommunicative Name :method: MetricFu::FlayGrapher#graph! :message: has the variable name 'g' - :type: Feature Envy :method: MetricFu::FlayGrapher#graph! :message: refers to g more than self :file_path: lib/graphs/flay_grapher.rb - :code_smells: - :type: Duplication :method: MetricFu::FlogGrapher#get_metrics :message: calls metrics[:flog] multiple times - :type: Duplication :method: MetricFu::FlogGrapher#get_metrics :message: calls self.labels multiple times - :type: Long Method :method: MetricFu::FlogGrapher#graph! :message: has approx 12 statements - :type: Uncommunicative Name :method: MetricFu::FlogGrapher#graph! :message: has the variable name 'g' - :type: Feature Envy :method: MetricFu::FlogGrapher#graph! :message: refers to g more than self :file_path: lib/graphs/flog_grapher.rb - :code_smells: - :type: Duplication :method: MetricFu::RcovGrapher#get_metrics :message: calls self.labels multiple times - :type: Long Method :method: MetricFu::RcovGrapher#graph! :message: has approx 11 statements - :type: Uncommunicative Name :method: MetricFu::RcovGrapher#graph! :message: has the variable name 'g' - :type: Feature Envy :method: MetricFu::RcovGrapher#graph! :message: refers to g more than self :file_path: lib/graphs/rcov_grapher.rb - :code_smells: - :type: Duplication :method: MetricFu::ReekGrapher#get_metrics :message: calls code_smell[:type] multiple times - :type: Duplication :method: MetricFu::ReekGrapher#get_metrics :message: calls self.labels multiple times - :type: Duplication :method: MetricFu::ReekGrapher#get_metrics :message: calls self.reek_count multiple times - :type: Duplication :method: MetricFu::ReekGrapher#get_metrics :message: calls self.reek_count[code_smell[:type]] multiple times - :type: Nested Iterators :method: MetricFu::ReekGrapher#get_metrics/block/block :message: is nested - :type: Long Method :method: MetricFu::ReekGrapher#graph! :message: has approx 11 statements - :type: Uncommunicative Name :method: MetricFu::ReekGrapher#graph! :message: has the variable name 'g' - :type: Feature Envy :method: MetricFu::ReekGrapher#graph! :message: refers to g more than self :file_path: lib/graphs/reek_grapher.rb - :code_smells: - :type: Duplication :method: MetricFu::RoodiGrapher#get_metrics :message: calls self.labels multiple times - :type: Long Method :method: MetricFu::RoodiGrapher#graph! :message: has approx 11 statements - :type: Uncommunicative Name :method: MetricFu::RoodiGrapher#graph! :message: has the variable name 'g' - :type: Feature Envy :method: MetricFu::RoodiGrapher#graph! :message: refers to g more than self :file_path: lib/graphs/roodi_grapher.rb - :code_smells: - :type: Uncommunicative Name :method: block :message: has the variable name 'l' :file_path: lib/metric_fu.rb - :code_smells: - :type: Utility Function :method: AwesomeTemplate#this_directory :message: doesn't depend on instance state - :type: Duplication :method: AwesomeTemplate#write :message: calls MetricFu.output_directory multiple times - :type: Duplication :method: AwesomeTemplate#write :message: calls MetricFu.report multiple times - :type: Duplication :method: AwesomeTemplate#write :message: calls MetricFu.report.save_output(html, MetricFu.output_directory, fn) multiple times - :type: Duplication :method: AwesomeTemplate#write :message: calls erbify("layout") multiple times - :type: Long Method :method: AwesomeTemplate#write :message: has approx 12 statements :file_path: lib/templates/awesome/awesome_template.rb - :code_smells: - :type: Utility Function :method: StandardTemplate#this_directory :message: doesn't depend on instance state - :type: Duplication :method: StandardTemplate#write :message: calls MetricFu.output_directory multiple times - :type: Duplication :method: StandardTemplate#write :message: calls MetricFu.report multiple times - :type: Duplication :method: StandardTemplate#write :message: calls MetricFu.report.save_output(html, MetricFu.output_directory, fn) multiple times - :type: Long Method :method: StandardTemplate#write :message: has approx 9 statements :file_path: lib/templates/standard/standard_template.rb :roodi: :problems: - :line: "110" :problem: Method name "get_elements" cyclomatic complexity is 9. It should be 8 or less. :file: lib/generators/saikuro.rb - :line: "17" :problem: Don't use class variables. You might want to try a different design. :file: lib/base/configuration.rb - :line: "42" :problem: Don't use class variables. You might want to try a different design. :file: lib/base/md5_tracker.rb - :line: "48" :problem: Don't use class variables. You might want to try a different design. :file: lib/base/md5_tracker.rb - :line: "120" :problem: Method "reset" has 47 lines. It should have 20 or less. :file: lib/base/configuration.rb - :line: "50" :problem: Method "analyze" has 29 lines. It should have 20 or less. :file: lib/generators/rcov.rb - :line: "29" :problem: Method "analyze" has 30 lines. It should have 20 or less. :file: lib/generators/saikuro.rb - :line: "110" :problem: Method "get_elements" has 21 lines. It should have 20 or less. :file: lib/generators/saikuro.rb - :line: "135" :problem: Method "merge_classes" has 23 lines. It should have 20 or less. :file: lib/generators/saikuro.rb - :line: "9" :problem: Method "analyze" has 26 lines. It should have 20 or less. :file: lib/generators/stats.rb - :line: "41" :problem: Found = in conditional. It should probably be an == :file: lib/generators/flog.rb - :line: "46" :problem: Found = in conditional. It should probably be an == :file: lib/generators/flog.rb - :line: "112" :problem: Found = in conditional. It should probably be an == :file: lib/generators/saikuro.rb :total: - Found 13 errors. :saikuro: :methods: - :complexity: 12 :name: MetricFu::Saikuro#analyze :lines: 31 - :complexity: 9 :name: MetricFu::Stats#analyze :lines: 27 - :complexity: 8 :name: MetricFu::Flog#parse :lines: 15 - :complexity: 8 :name: MetricFu::Rcov#analyze :lines: 30 - :complexity: 8 :name: MetricFu::Saikuro#get_elements :lines: 22 - :complexity: 7 :name: MetricFu::Flog#emit :lines: 17 - :complexity: 7 :name: MetricFu::Saikuro#merge_classes :lines: 24 - :complexity: 5 :name: MetricFu::Reek#analyze :lines: 14 - :complexity: 5 :name: MetricFu::Flog#to_h :lines: 7 - :complexity: 5 :name: MetricFu::ReekGrapher#get_metrics :lines: 11 - :complexity: 5 :name: MetricFu::Configuration#warn_about_deprecated_config_options :lines: 14 - :complexity: 4 :name: AwesomeTemplate#write :lines: 21 - :complexity: 4 :name: MetricFu::MD5Tracker::#file_changed? :lines: 16 - :complexity: 4 :name: StandardTemplate#write :lines: 16 - :complexity: 4 :name: MetricFu::Saikuro#emit :lines: 17 - :complexity: 4 :name: MetricFu::Saikuro#to_h :lines: 11 - :complexity: 4 :name: MetricFu::Graph#generate :lines: 14 - :complexity: 4 :name: MetricFu::Flog#analyze :lines: 9 - :complexity: 4 :name: MetricFu::Roodi#analyze :lines: 10 - :complexity: 3 :name: MetricFu::Saikuro#self.is_valid_text_file? :lines: 8 - :complexity: 3 :name: MetricFu::Rcov#emit :lines: 15 - :complexity: 3 :name: MetricFu::Saikuro#to_h :lines: 11 - :complexity: 3 :name: MetricFu::Churn#parse_log_for_changes :lines: 8 - :complexity: 3 :name: MetricFu::Rcov#self.verify_dependencies! :lines: 9 - :complexity: 3 :name: MetricFu::Churn#initialize :lines: 10 - :complexity: 3 :name: MetricFu::Saikuro#get_class_names :lines: 8 - :complexity: 3 :name: MetricFu::Flog#highest_score :lines: 4 - :complexity: 3 :name: MetricFu::Template#file_url :lines: 7 - :complexity: 3 :name: MetricFu::Flay#to_h :lines: 12 - :complexity: 3 :name: MetricFu::Template#link_content :lines: 8 - :complexity: 3 :name: MetricFu::Churn#analyze :lines: 3 - :complexity: 2 :name: MetricFu::Template#cycle :lines: 3 - :complexity: 2 :name: MetricFu::Report#show_in_browser :lines: 2 - :complexity: 2 :name: MetricFu::Configuration#add_attr_accessors_to_self :lines: 5 - :complexity: 2 :name: MetricFu::Report#save_output :lines: 4 - :complexity: 2 :name: MetricFu::Flay#emit :lines: 3 - :complexity: 2 :name: MetricFu::Configuration#set_metrics :lines: 6 - :complexity: 2 :name: MetricFu::Configuration#set_code_dirs :lines: 6 - :complexity: 2 :name: MetricFu::Template#inline_css :lines: 2 - :complexity: 2 :name: MetricFu::Flay#analyze :lines: 2 - :complexity: 2 :name: MetricFu::Configuration#add_class_methods_to_metric_fu :lines: 6 - :complexity: 2 :name: MetricFu::ReekGrapher#graph! :lines: 14 - :complexity: 2 :name: MetricFu::Roodi#emit :lines: 3 - :complexity: 2 :name: MetricFu::Roodi#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Flay#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Generator#generate_report :lines: 8 - :complexity: 2 :name: MetricFu::Reek#emit :lines: 3 - :complexity: 2 :name: MetricFu::Reek#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Generator#create_data_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Generator#create_output_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Churn#emit :lines: 2 - :complexity: 2 :name: MetricFu::Churn::Svn#clean_up_svn_line :lines: 3 - :complexity: 2 :name: MetricFu::Churn::Svn#date_range :lines: 5 - :complexity: 2 :name: MetricFu::Churn::Svn#get_logs :lines: 2 - :complexity: 2 :name: MetricFu::Churn::Git#date_range :lines: 5 - :complexity: 2 :name: MetricFu::Churn::Git#get_logs :lines: 2 - :complexity: 2 :name: MetricFu::Flog#to_h :lines: 6 - :complexity: 2 :name: MetricFu::Flog::ScannedMethod#to_h :lines: 4 - :complexity: 2 :name: MetricFu::Flog#average_score :lines: 3 - :complexity: 2 :name: MetricFu::Flog#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Generator#create_metric_dir_if_missing :lines: 4 - :complexity: 1 :name: MetricFu::Churn#self.git? :lines: 2 - :complexity: 1 :name: MetricFu::Churn#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Rcov::Line#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Rcov::Line#initialize :lines: 3 - :complexity: 1 :name: MetricFu::Rcov#to_h :lines: 3 - :complexity: 1 :name: MetricFu::Churn::SourceControl#initialize :lines: 2 - :complexity: 1 :name: MetricFu::Stats#emit :lines: 2 - :complexity: 1 :name: MetricFu::Stats#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Reek#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Roodi#to_h :lines: 2 - :complexity: 1 :name: MetricFu#self.report :lines: 2 - :complexity: 1 :name: MetricFu::Template#link_to_filename :lines: 2 - :complexity: 1 :name: MetricFu::Report#to_yaml :lines: 2 - :complexity: 1 :name: MetricFu::Template#output_filename :lines: 2 - :complexity: 1 :name: MetricFu::Template#template :lines: 2 - :complexity: 1 :name: MetricFu::Template#create_instance_var :lines: 2 - :complexity: 1 :name: MetricFu::Template#template_exists? :lines: 2 - :complexity: 1 :name: MetricFu::Template#erbify :lines: 4 - :complexity: 1 :name: MetricFu::Configuration#is_cruise_control_rb? :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#platform :lines: 2 - :complexity: 1 :name: MetricFu::Report#report_hash :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#set_graphs :lines: 2 - :complexity: 1 :name: MetricFu::Report#save_templatized_report :lines: 4 - :complexity: 1 :name: MetricFu::Configuration#rails? :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#reset :lines: 48 - :complexity: 1 :name: MetricFu::Configuration#self.run :lines: 2 - :complexity: 1 :name: MetricFu::Report#add :lines: 3 - :complexity: 1 :name: MetricFu::Report#open_in_browser? :lines: 3 - :complexity: 1 :name: MetricFu::ReekGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::Configuration#initialize :lines: 5 - :complexity: 1 :name: MetricFu#self.configuration :lines: 2 - :complexity: 1 :name: MetricFu::Generator#to_graph :lines: 2 - :complexity: 1 :name: MetricFu::Generator#analyze :lines: 2 - :complexity: 1 :name: MetricFu::Generator#emit :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.verify_dependencies! :lines: 2 - :complexity: 1 :name: MetricFu::Generator#round_to_tenths :lines: 2 - :complexity: 1 :name: MetricFu::MD5Tracker::#md5_dir :lines: 3 - :complexity: 1 :name: MetricFu::Generator#metric_directory :lines: 2 - :complexity: 1 :name: MetricFu::MD5Tracker::#md5_file :lines: 3 - :complexity: 1 :name: MetricFu::MD5Tracker::#track :lines: 7 - :complexity: 1 :name: MetricFu::MD5Tracker::#file_already_counted? :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.metric_directory :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.class_name :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.generate_report :lines: 3 - :complexity: 1 :name: MetricFu::Generator#initialize :lines: 5 - :complexity: 1 :name: MetricFu#self.graph :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#<< :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#initialize :lines: 7 - :complexity: 1 :name: MetricFu::Graph#initialize :lines: 2 - :complexity: 1 :name: MetricFu::Graph#add :lines: 3 - :complexity: 1 :name: AwesomeTemplate#this_directory :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#to_h :lines: 3 - :complexity: 1 :name: MetricFu::Saikuro#filename :lines: 2 - :complexity: 1 :name: StandardTemplate#this_directory :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#initialize :lines: 5 - :complexity: 1 :name: MetricFu::Saikuro#saikuro_results :lines: 2 - :complexity: 1 :name: MetricFu::RoodiGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::RoodiGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::Saikuro#format_directories :lines: 3 - :complexity: 1 :name: MetricFu::RoodiGrapher#graph! :lines: 12 - :complexity: 1 :name: MetricFu::RcovGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::RcovGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::Flog#filename :lines: 2 - :complexity: 1 :name: MetricFu::Flog#initialize :lines: 4 - :complexity: 1 :name: MetricFu::RcovGrapher#graph! :lines: 12 - :complexity: 1 :name: MetricFu::Flog::ScannedMethod#initialize :lines: 4 - :complexity: 1 :name: MetricFu::Flog::Operator#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Flog::Operator#initialize :lines: 3 - :complexity: 1 :name: MetricFu::Flog#flog_results :lines: 2 - :complexity: 1 :name: MetricFu::FlogGrapher#initialize :lines: 4 - :complexity: 1 :name: MetricFu::FlogGrapher#get_metrics :lines: 4 - :complexity: 1 :name: MetricFu::FlogGrapher#graph! :lines: 13 - :complexity: 1 :name: MetricFu::FlayGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::FlayGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::FlayGrapher#graph! :lines: 12 :files: - :filename: flog.rb :classes: - :methods: [] :complexity: 0 :lines: 5 :class_name: MetricFu - :methods: - :complexity: 8 :name: MetricFu::Flog#parse :lines: 15 - :complexity: 7 :name: MetricFu::Flog#emit :lines: 17 - :complexity: 5 :name: MetricFu::Flog#to_h :lines: 7 - :complexity: 4 :name: MetricFu::Flog#analyze :lines: 9 - :complexity: 3 :name: MetricFu::Flog#highest_score :lines: 4 - :complexity: 2 :name: MetricFu::Flog#average_score :lines: 3 - :complexity: 2 :name: MetricFu::Flog#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Flog#to_h :lines: 6 - :complexity: 1 :name: MetricFu::Flog#filename :lines: 2 - :complexity: 1 :name: MetricFu::Flog#initialize :lines: 4 - :complexity: 1 :name: MetricFu::Flog#flog_results :lines: 2 :complexity: 36 :lines: 109 :class_name: MetricFu::Flog - :methods: - :complexity: 1 :name: MetricFu::Flog::Operator#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Flog::Operator#initialize :lines: 3 :complexity: 2 :lines: 11 :class_name: MetricFu::Flog::Operator - :methods: - :complexity: 2 :name: MetricFu::Flog::ScannedMethod#to_h :lines: 4 - :complexity: 1 :name: MetricFu::Flog::ScannedMethod#initialize :lines: 4 :complexity: 3 :lines: 14 :class_name: MetricFu::Flog::ScannedMethod - :filename: saikuro.rb :classes: - :methods: [] :complexity: 0 :lines: 7 :class_name: MetricFu - :methods: - :complexity: 12 :name: MetricFu::Saikuro#analyze :lines: 31 - :complexity: 8 :name: MetricFu::Saikuro#get_elements :lines: 22 - :complexity: 7 :name: MetricFu::Saikuro#merge_classes :lines: 24 - :complexity: 4 :name: MetricFu::Saikuro#to_h :lines: 11 - :complexity: 4 :name: MetricFu::Saikuro#emit :lines: 17 - :complexity: 3 :name: MetricFu::Saikuro#to_h :lines: 11 - :complexity: 3 :name: MetricFu::Saikuro#self.is_valid_text_file? :lines: 8 - :complexity: 3 :name: MetricFu::Saikuro#get_class_names :lines: 8 - :complexity: 1 :name: MetricFu::Saikuro#saikuro_results :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#initialize :lines: 5 - :complexity: 1 :name: MetricFu::Saikuro#to_h :lines: 3 - :complexity: 1 :name: MetricFu::Saikuro#initialize :lines: 7 - :complexity: 1 :name: MetricFu::Saikuro#<< :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#format_directories :lines: 3 - :complexity: 1 :name: MetricFu::Saikuro#filename :lines: 2 :complexity: 51 :lines: 200 :class_name: MetricFu::Saikuro - :filename: generator.rb :classes: - :methods: [] :complexity: 0 :lines: 32 :class_name: MetricFu - :methods: - :complexity: 2 :name: MetricFu::Generator#create_metric_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Generator#create_output_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Generator#create_data_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Generator#generate_report :lines: 8 - :complexity: 1 :name: MetricFu::Generator#metric_directory :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.verify_dependencies! :lines: 2 - :complexity: 1 :name: MetricFu::Generator#round_to_tenths :lines: 2 - :complexity: 1 :name: MetricFu::Generator#emit :lines: 2 - :complexity: 1 :name: MetricFu::Generator#analyze :lines: 2 - :complexity: 1 :name: MetricFu::Generator#to_graph :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.metric_directory :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.class_name :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.generate_report :lines: 3 - :complexity: 1 :name: MetricFu::Generator#initialize :lines: 5 :complexity: 22 :lines: 115 :class_name: MetricFu::Generator - :filename: configuration.rb :classes: - :methods: - :complexity: 1 :name: MetricFu#self.configuration :lines: 2 :complexity: 1 :lines: 51 :class_name: MetricFu - :methods: - :complexity: 5 :name: MetricFu::Configuration#warn_about_deprecated_config_options :lines: 14 - :complexity: 2 :name: MetricFu::Configuration#set_code_dirs :lines: 6 - :complexity: 2 :name: MetricFu::Configuration#add_attr_accessors_to_self :lines: 5 - :complexity: 2 :name: MetricFu::Configuration#add_class_methods_to_metric_fu :lines: 6 - :complexity: 2 :name: MetricFu::Configuration#set_metrics :lines: 6 - :complexity: 1 :name: MetricFu::Configuration#rails? :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#reset :lines: 48 - :complexity: 1 :name: MetricFu::Configuration#self.run :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#set_graphs :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#platform :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#is_cruise_control_rb? :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#initialize :lines: 5 :complexity: 20 :lines: 151 :class_name: MetricFu::Configuration - :filename: base_template.rb :classes: - :methods: [] :complexity: 0 :lines: 10 :class_name: MetricFu - :methods: - :complexity: 3 :name: MetricFu::Template#link_content :lines: 8 - :complexity: 3 :name: MetricFu::Template#file_url :lines: 7 - :complexity: 2 :name: MetricFu::Template#cycle :lines: 3 - :complexity: 2 :name: MetricFu::Template#inline_css :lines: 2 - :complexity: 1 :name: MetricFu::Template#link_to_filename :lines: 2 - :complexity: 1 :name: MetricFu::Template#output_filename :lines: 2 - :complexity: 1 :name: MetricFu::Template#template :lines: 2 - :complexity: 1 :name: MetricFu::Template#create_instance_var :lines: 2 - :complexity: 1 :name: MetricFu::Template#template_exists? :lines: 2 - :complexity: 1 :name: MetricFu::Template#erbify :lines: 4 :complexity: 16 :lines: 135 :class_name: MetricFu::Template - :filename: rcov.rb :classes: - :methods: [] :complexity: 0 :lines: 3 :class_name: MetricFu - :methods: - :complexity: 8 :name: MetricFu::Rcov#analyze :lines: 30 - :complexity: 3 :name: MetricFu::Rcov#self.verify_dependencies! :lines: 9 - :complexity: 3 :name: MetricFu::Rcov#emit :lines: 15 - :complexity: 1 :name: MetricFu::Rcov#to_h :lines: 3 :complexity: 15 :lines: 70 :class_name: MetricFu::Rcov - :methods: - :complexity: 1 :name: MetricFu::Rcov::Line#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Rcov::Line#initialize :lines: 3 :complexity: 2 :lines: 11 :class_name: MetricFu::Rcov::Line - :filename: churn.rb :classes: - :methods: [] :complexity: 0 :lines: 3 :class_name: MetricFu - :methods: - :complexity: 3 :name: MetricFu::Churn#parse_log_for_changes :lines: 8 - :complexity: 3 :name: MetricFu::Churn#initialize :lines: 10 - :complexity: 3 :name: MetricFu::Churn#analyze :lines: 3 - :complexity: 2 :name: MetricFu::Churn#emit :lines: 2 - :complexity: 1 :name: MetricFu::Churn#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Churn#self.git? :lines: 2 :complexity: 13 :lines: 51 :class_name: MetricFu::Churn - :methods: - :complexity: 1 :name: MetricFu::Churn::SourceControl#initialize :lines: 2 :complexity: 1 :lines: 4 :class_name: MetricFu::Churn::SourceControl - :methods: - :complexity: 2 :name: MetricFu::Churn::Git#date_range :lines: 5 - :complexity: 2 :name: MetricFu::Churn::Git#get_logs :lines: 2 :complexity: 4 :lines: 13 :class_name: MetricFu::Churn::Git - :methods: - :complexity: 2 :name: MetricFu::Churn::Svn#clean_up_svn_line :lines: 3 - :complexity: 2 :name: MetricFu::Churn::Svn#date_range :lines: 5 - :complexity: 2 :name: MetricFu::Churn::Svn#get_logs :lines: 2 :complexity: 6 :lines: 17 :class_name: MetricFu::Churn::Svn - :filename: stats.rb :classes: - :methods: [] :complexity: 0 :lines: 3 :class_name: MetricFu - :methods: - :complexity: 9 :name: MetricFu::Stats#analyze :lines: 27 - :complexity: 1 :name: MetricFu::Stats#to_h :lines: 2 - :complexity: 1 :name: MetricFu::Stats#emit :lines: 2 :complexity: 11 :lines: 39 :class_name: MetricFu::Stats - :filename: reek.rb :classes: - :methods: [] :complexity: 0 :lines: 3 :class_name: MetricFu - :methods: - :complexity: 5 :name: MetricFu::Reek#analyze :lines: 14 - :complexity: 2 :name: MetricFu::Reek#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Reek#emit :lines: 3 - :complexity: 1 :name: MetricFu::Reek#to_h :lines: 2 :complexity: 10 :lines: 33 :class_name: MetricFu::Reek - :filename: roodi.rb :classes: - :methods: [] :complexity: 0 :lines: 2 :class_name: MetricFu - :methods: - :complexity: 4 :name: MetricFu::Roodi#analyze :lines: 10 - :complexity: 2 :name: MetricFu::Roodi#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Roodi#emit :lines: 3 - :complexity: 1 :name: MetricFu::Roodi#to_h :lines: 2 :complexity: 9 :lines: 28 :class_name: MetricFu::Roodi - :filename: report.rb :classes: - :methods: - :complexity: 1 :name: MetricFu#self.report :lines: 2 :complexity: 1 :lines: 19 :class_name: MetricFu - :methods: - :complexity: 2 :name: MetricFu::Report#show_in_browser :lines: 2 - :complexity: 2 :name: MetricFu::Report#save_output :lines: 4 - :complexity: 1 :name: MetricFu::Report#add :lines: 3 - :complexity: 1 :name: MetricFu::Report#open_in_browser? :lines: 3 - :complexity: 1 :name: MetricFu::Report#save_templatized_report :lines: 4 - :complexity: 1 :name: MetricFu::Report#report_hash :lines: 2 - :complexity: 1 :name: MetricFu::Report#to_yaml :lines: 2 :complexity: 9 :lines: 80 :class_name: MetricFu::Report - :filename: flay.rb :classes: - :methods: [] :complexity: 0 :lines: 3 :class_name: MetricFu - :methods: - :complexity: 3 :name: MetricFu::Flay#to_h :lines: 12 - :complexity: 2 :name: MetricFu::Flay#analyze :lines: 2 - :complexity: 2 :name: MetricFu::Flay#emit :lines: 3 - :complexity: 2 :name: MetricFu::Flay#self.verify_dependencies! :lines: 3 :complexity: 9 :lines: 29 :class_name: MetricFu::Flay - :filename: reek_grapher.rb :classes: - :methods: [] :complexity: 0 :lines: 4 :class_name: MetricFu - :methods: - :complexity: 5 :name: MetricFu::ReekGrapher#get_metrics :lines: 11 - :complexity: 2 :name: MetricFu::ReekGrapher#graph! :lines: 14 - :complexity: 1 :name: MetricFu::ReekGrapher#initialize :lines: 3 :complexity: 8 :lines: 38 :class_name: MetricFu::ReekGrapher - :filename: md5_tracker.rb :classes: - :methods: [] :complexity: 0 :lines: 2 :class_name: MetricFu - :methods: [] :complexity: 0 :lines: 5 :class_name: MetricFu::MD5Tracker - :methods: - :complexity: 4 :name: MetricFu::MD5Tracker::#file_changed? :lines: 16 - :complexity: 1 :name: MetricFu::MD5Tracker::#track :lines: 7 - :complexity: 1 :name: MetricFu::MD5Tracker::#file_already_counted? :lines: 2 - :complexity: 1 :name: MetricFu::MD5Tracker::#md5_file :lines: 3 - :complexity: 1 :name: MetricFu::MD5Tracker::#md5_dir :lines: 3 :complexity: 8 :lines: 41 :class_name: "MetricFu::MD5Tracker::" - :filename: graph.rb :classes: - :methods: - :complexity: 1 :name: MetricFu#self.graph :lines: 2 :complexity: 1 :lines: 7 :class_name: MetricFu - :methods: - :complexity: 4 :name: MetricFu::Graph#generate :lines: 14 - :complexity: 1 :name: MetricFu::Graph#add :lines: 3 - :complexity: 1 :name: MetricFu::Graph#initialize :lines: 2 :complexity: 6 :lines: 29 :class_name: MetricFu::Graph - :filename: awesome_template.rb :classes: - :methods: - :complexity: 4 :name: AwesomeTemplate#write :lines: 21 - :complexity: 1 :name: AwesomeTemplate#this_directory :lines: 2 :complexity: 5 :lines: 28 :class_name: AwesomeTemplate - :filename: standard_template.rb :classes: - :methods: - :complexity: 4 :name: StandardTemplate#write :lines: 16 - :complexity: 1 :name: StandardTemplate#this_directory :lines: 2 :complexity: 5 :lines: 24 :class_name: StandardTemplate - :filename: roodi_grapher.rb :classes: - :methods: [] :complexity: 0 :lines: 4 :class_name: MetricFu - :methods: - :complexity: 1 :name: MetricFu::RoodiGrapher#graph! :lines: 12 - :complexity: 1 :name: MetricFu::RoodiGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::RoodiGrapher#initialize :lines: 3 :complexity: 3 :lines: 28 :class_name: MetricFu::RoodiGrapher - :filename: rcov_grapher.rb :classes: - :methods: [] :complexity: 0 :lines: 4 :class_name: MetricFu - :methods: - :complexity: 1 :name: MetricFu::RcovGrapher#graph! :lines: 12 - :complexity: 1 :name: MetricFu::RcovGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::RcovGrapher#initialize :lines: 3 :complexity: 3 :lines: 28 :class_name: MetricFu::RcovGrapher - :filename: flog_grapher.rb :classes: - :methods: [] :complexity: 0 :lines: 4 :class_name: MetricFu - :methods: - :complexity: 1 :name: MetricFu::FlogGrapher#graph! :lines: 13 - :complexity: 1 :name: MetricFu::FlogGrapher#get_metrics :lines: 4 - :complexity: 1 :name: MetricFu::FlogGrapher#initialize :lines: 4 :complexity: 3 :lines: 31 :class_name: MetricFu::FlogGrapher - :filename: flay_grapher.rb :classes: - :methods: [] :complexity: 0 :lines: 4 :class_name: MetricFu - :methods: - :complexity: 1 :name: MetricFu::FlayGrapher#graph! :lines: 12 - :complexity: 1 :name: MetricFu::FlayGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::FlayGrapher#initialize :lines: 3 :complexity: 3 :lines: 28 :class_name: MetricFu::FlayGrapher - :filename: metric_fu.rb :classes: - :methods: [] :complexity: 1 :lines: 0 :class_name: "" - :methods: [] :complexity: 0 :lines: 2 :class_name: MetricFu :classes: - :defs: - :complexity: 2 :name: MetricFu::Flog#self.verify_dependencies! :lines: 3 - :complexity: 7 :name: MetricFu::Flog#emit :lines: 17 - :complexity: 8 :name: MetricFu::Flog#parse :lines: 15 - :complexity: 4 :name: MetricFu::Flog#analyze :lines: 9 - :complexity: 5 :name: MetricFu::Flog#to_h :lines: 7 - :complexity: 2 :name: MetricFu::Flog#average_score :lines: 3 - :complexity: 1 :name: MetricFu::Flog#flog_results :lines: 2 :complexity: 29 :name: MetricFu::Flog :lines: 83 - :defs: - :complexity: 1 :name: MetricFu::Saikuro#initialize :lines: 5 - :complexity: 3 :name: MetricFu::Saikuro#self.is_valid_text_file? :lines: 8 - :complexity: 1 :name: MetricFu::Saikuro#filename :lines: 2 - :complexity: 1 :name: MetricFu::Saikuro#to_h :lines: 3 - :complexity: 8 :name: MetricFu::Saikuro#get_elements :lines: 22 - :complexity: 7 :name: MetricFu::Saikuro#merge_classes :lines: 24 - :complexity: 3 :name: MetricFu::Saikuro#get_class_names :lines: 8 :complexity: 24 :name: MetricFu::Saikuro :lines: 91 - :defs: - :complexity: 1 :name: MetricFu::Generator#initialize :lines: 5 - :complexity: 1 :name: MetricFu::Generator#self.generate_report :lines: 3 - :complexity: 1 :name: MetricFu::Generator#self.class_name :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.metric_directory :lines: 2 - :complexity: 2 :name: MetricFu::Generator#create_metric_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Generator#create_output_dir_if_missing :lines: 4 - :complexity: 2 :name: MetricFu::Generator#create_data_dir_if_missing :lines: 4 - :complexity: 1 :name: MetricFu::Generator#metric_directory :lines: 2 - :complexity: 2 :name: MetricFu::Generator#generate_report :lines: 8 - :complexity: 1 :name: MetricFu::Generator#round_to_tenths :lines: 2 - :complexity: 1 :name: MetricFu::Generator#self.verify_dependencies! :lines: 2 - :complexity: 1 :name: MetricFu::Generator#emit :lines: 2 - :complexity: 1 :name: MetricFu::Generator#analyze :lines: 2 - :complexity: 1 :name: MetricFu::Generator#to_graph :lines: 2 :complexity: 22 :name: MetricFu::Generator :lines: 115 - :defs: - :complexity: 4 :name: MetricFu::Saikuro#emit :lines: 17 - :complexity: 1 :name: MetricFu::Saikuro#format_directories :lines: 3 - :complexity: 12 :name: MetricFu::Saikuro#analyze :lines: 31 - :complexity: 4 :name: MetricFu::Saikuro#to_h :lines: 11 - :complexity: 1 :name: MetricFu::Saikuro#saikuro_results :lines: 2 :complexity: 22 :name: MetricFu::Saikuro :lines: 75 - :defs: - :complexity: 1 :name: MetricFu::Configuration#initialize :lines: 5 - :complexity: 2 :name: MetricFu::Configuration#add_class_methods_to_metric_fu :lines: 6 - :complexity: 2 :name: MetricFu::Configuration#add_attr_accessors_to_self :lines: 5 - :complexity: 5 :name: MetricFu::Configuration#warn_about_deprecated_config_options :lines: 14 - :complexity: 1 :name: MetricFu::Configuration#self.run :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#reset :lines: 48 - :complexity: 1 :name: MetricFu::Configuration#rails? :lines: 2 - :complexity: 2 :name: MetricFu::Configuration#set_metrics :lines: 6 - :complexity: 1 :name: MetricFu::Configuration#set_graphs :lines: 2 - :complexity: 2 :name: MetricFu::Configuration#set_code_dirs :lines: 6 - :complexity: 1 :name: MetricFu::Configuration#platform :lines: 2 - :complexity: 1 :name: MetricFu::Configuration#is_cruise_control_rb? :lines: 2 :complexity: 20 :name: MetricFu::Configuration :lines: 151 - :defs: - :complexity: 1 :name: MetricFu::Template#erbify :lines: 4 - :complexity: 1 :name: MetricFu::Template#template_exists? :lines: 2 - :complexity: 1 :name: MetricFu::Template#create_instance_var :lines: 2 - :complexity: 1 :name: MetricFu::Template#template :lines: 2 - :complexity: 1 :name: MetricFu::Template#output_filename :lines: 2 - :complexity: 2 :name: MetricFu::Template#inline_css :lines: 2 - :complexity: 1 :name: MetricFu::Template#link_to_filename :lines: 2 - :complexity: 3 :name: MetricFu::Template#link_content :lines: 8 - :complexity: 3 :name: MetricFu::Template#file_url :lines: 7 - :complexity: 2 :name: MetricFu::Template#cycle :lines: 3 :complexity: 16 :name: MetricFu::Template :lines: 135 - :defs: - :complexity: 3 :name: MetricFu::Rcov#self.verify_dependencies! :lines: 9 - :complexity: 3 :name: MetricFu::Rcov#emit :lines: 15 - :complexity: 8 :name: MetricFu::Rcov#analyze :lines: 30 - :complexity: 1 :name: MetricFu::Rcov#to_h :lines: 3 :complexity: 15 :name: MetricFu::Rcov :lines: 70 - :defs: - :complexity: 3 :name: MetricFu::Churn#initialize :lines: 10 - :complexity: 1 :name: MetricFu::Churn#self.git? :lines: 2 - :complexity: 2 :name: MetricFu::Churn#emit :lines: 2 - :complexity: 3 :name: MetricFu::Churn#analyze :lines: 3 - :complexity: 1 :name: MetricFu::Churn#to_h :lines: 2 - :complexity: 3 :name: MetricFu::Churn#parse_log_for_changes :lines: 8 :complexity: 13 :name: MetricFu::Churn :lines: 51 - :defs: - :complexity: 1 :name: MetricFu::Stats#emit :lines: 2 - :complexity: 9 :name: MetricFu::Stats#analyze :lines: 27 - :complexity: 1 :name: MetricFu::Stats#to_h :lines: 2 :complexity: 11 :name: MetricFu::Stats :lines: 39 - :defs: - :complexity: 2 :name: MetricFu::Reek#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Reek#emit :lines: 3 - :complexity: 5 :name: MetricFu::Reek#analyze :lines: 14 - :complexity: 1 :name: MetricFu::Reek#to_h :lines: 2 :complexity: 10 :name: MetricFu::Reek :lines: 33 - :defs: - :complexity: 1 :name: MetricFu::Report#to_yaml :lines: 2 - :complexity: 1 :name: MetricFu::Report#report_hash :lines: 2 - :complexity: 1 :name: MetricFu::Report#save_templatized_report :lines: 4 - :complexity: 1 :name: MetricFu::Report#add :lines: 3 - :complexity: 2 :name: MetricFu::Report#save_output :lines: 4 - :complexity: 1 :name: MetricFu::Report#open_in_browser? :lines: 3 - :complexity: 2 :name: MetricFu::Report#show_in_browser :lines: 2 :complexity: 9 :name: MetricFu::Report :lines: 80 - :defs: - :complexity: 2 :name: MetricFu::Flay#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Flay#emit :lines: 3 - :complexity: 2 :name: MetricFu::Flay#analyze :lines: 2 - :complexity: 3 :name: MetricFu::Flay#to_h :lines: 12 :complexity: 9 :name: MetricFu::Flay :lines: 29 - :defs: - :complexity: 2 :name: MetricFu::Roodi#self.verify_dependencies! :lines: 3 - :complexity: 2 :name: MetricFu::Roodi#emit :lines: 3 - :complexity: 4 :name: MetricFu::Roodi#analyze :lines: 10 - :complexity: 1 :name: MetricFu::Roodi#to_h :lines: 2 :complexity: 9 :name: MetricFu::Roodi :lines: 28 - :defs: - :complexity: 1 :name: MetricFu::ReekGrapher#initialize :lines: 3 - :complexity: 5 :name: MetricFu::ReekGrapher#get_metrics :lines: 11 - :complexity: 2 :name: MetricFu::ReekGrapher#graph! :lines: 14 :complexity: 8 :name: MetricFu::ReekGrapher :lines: 38 - :defs: - :complexity: 1 :name: MetricFu::MD5Tracker::#md5_dir :lines: 3 - :complexity: 1 :name: MetricFu::MD5Tracker::#md5_file :lines: 3 - :complexity: 1 :name: MetricFu::MD5Tracker::#track :lines: 7 - :complexity: 4 :name: MetricFu::MD5Tracker::#file_changed? :lines: 16 - :complexity: 1 :name: MetricFu::MD5Tracker::#file_already_counted? :lines: 2 :complexity: 8 :name: "MetricFu::MD5Tracker::" :lines: 41 - :defs: - :complexity: 1 :name: MetricFu::Flog#initialize :lines: 4 - :complexity: 1 :name: MetricFu::Flog#filename :lines: 2 - :complexity: 2 :name: MetricFu::Flog#to_h :lines: 6 - :complexity: 3 :name: MetricFu::Flog#highest_score :lines: 4 :complexity: 7 :name: MetricFu::Flog :lines: 26 - :defs: - :complexity: 2 :name: MetricFu::Churn::Svn#get_logs :lines: 2 - :complexity: 2 :name: MetricFu::Churn::Svn#date_range :lines: 5 - :complexity: 2 :name: MetricFu::Churn::Svn#clean_up_svn_line :lines: 3 :complexity: 6 :name: MetricFu::Churn::Svn :lines: 17 - :defs: - :complexity: 1 :name: MetricFu::Graph#initialize :lines: 2 - :complexity: 1 :name: MetricFu::Graph#add :lines: 3 - :complexity: 4 :name: MetricFu::Graph#generate :lines: 14 :complexity: 6 :name: MetricFu::Graph :lines: 29 - :defs: - :complexity: 4 :name: StandardTemplate#write :lines: 16 - :complexity: 1 :name: StandardTemplate#this_directory :lines: 2 :complexity: 5 :name: StandardTemplate :lines: 24 - :defs: - :complexity: 1 :name: MetricFu::Saikuro#initialize :lines: 7 - :complexity: 1 :name: MetricFu::Saikuro#<< :lines: 2 - :complexity: 3 :name: MetricFu::Saikuro#to_h :lines: 11 :complexity: 5 :name: MetricFu::Saikuro :lines: 34 - :defs: - :complexity: 4 :name: AwesomeTemplate#write :lines: 21 - :complexity: 1 :name: AwesomeTemplate#this_directory :lines: 2 :complexity: 5 :name: AwesomeTemplate :lines: 28 - :defs: - :complexity: 2 :name: MetricFu::Churn::Git#get_logs :lines: 2 - :complexity: 2 :name: MetricFu::Churn::Git#date_range :lines: 5 :complexity: 4 :name: MetricFu::Churn::Git :lines: 13 - :defs: - :complexity: 1 :name: MetricFu::RoodiGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::RoodiGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::RoodiGrapher#graph! :lines: 12 :complexity: 3 :name: MetricFu::RoodiGrapher :lines: 28 - :defs: - :complexity: 1 :name: MetricFu::Flog::ScannedMethod#initialize :lines: 4 - :complexity: 2 :name: MetricFu::Flog::ScannedMethod#to_h :lines: 4 :complexity: 3 :name: MetricFu::Flog::ScannedMethod :lines: 14 - :defs: - :complexity: 1 :name: MetricFu::FlayGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::FlayGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::FlayGrapher#graph! :lines: 12 :complexity: 3 :name: MetricFu::FlayGrapher :lines: 28 - :defs: - :complexity: 1 :name: MetricFu::RcovGrapher#initialize :lines: 3 - :complexity: 1 :name: MetricFu::RcovGrapher#get_metrics :lines: 3 - :complexity: 1 :name: MetricFu::RcovGrapher#graph! :lines: 12 :complexity: 3 :name: MetricFu::RcovGrapher :lines: 28 - :defs: - :complexity: 1 :name: MetricFu::FlogGrapher#initialize :lines: 4 - :complexity: 1 :name: MetricFu::FlogGrapher#get_metrics :lines: 4 - :complexity: 1 :name: MetricFu::FlogGrapher#graph! :lines: 13 :complexity: 3 :name: MetricFu::FlogGrapher :lines: 31 - :defs: - :complexity: 1 :name: MetricFu::Flog::Operator#initialize :lines: 3 - :complexity: 1 :name: MetricFu::Flog::Operator#to_h :lines: 2 :complexity: 2 :name: MetricFu::Flog::Operator :lines: 11 - :defs: - :complexity: 1 :name: MetricFu::Rcov::Line#initialize :lines: 3 - :complexity: 1 :name: MetricFu::Rcov::Line#to_h :lines: 2 :complexity: 2 :name: MetricFu::Rcov::Line :lines: 11 - :defs: - :complexity: 1 :name: MetricFu#self.report :lines: 2 :complexity: 1 :name: MetricFu :lines: 19 - :defs: - :complexity: 1 :name: MetricFu#self.graph :lines: 2 :complexity: 1 :name: MetricFu :lines: 7 - :defs: - :complexity: 1 :name: MetricFu::Churn::SourceControl#initialize :lines: 2 :complexity: 1 :name: MetricFu::Churn::SourceControl :lines: 4 - :complexity: 1 :name: "" :lines: 0 - :defs: - :complexity: 1 :name: MetricFu#self.configuration :lines: 2 :complexity: 1 :name: MetricFu :lines: 51 - :complexity: 0 :name: MetricFu :lines: 2 - :complexity: 0 :name: MetricFu :lines: 3 - :complexity: 0 :name: MetricFu :lines: 3 - :complexity: 0 :name: MetricFu :lines: 3 - :complexity: 0 :name: MetricFu :lines: 10 - :complexity: 0 :name: MetricFu :lines: 3 - :complexity: 0 :name: MetricFu :lines: 2 - :complexity: 0 :name: MetricFu :lines: 3 - :complexity: 0 :name: MetricFu :lines: 32 - :complexity: 0 :name: MetricFu :lines: 4 - :complexity: 0 :name: MetricFu :lines: 2 - :complexity: 0 :name: MetricFu::MD5Tracker :lines: 5 - :complexity: 0 :name: MetricFu :lines: 7 - :complexity: 0 :name: MetricFu :lines: 4 - :complexity: 0 :name: MetricFu :lines: 4 - :complexity: 0 :name: MetricFu :lines: 4 - :complexity: 0 :name: MetricFu :lines: 4 - :complexity: 0 :name: MetricFu :lines: 5 :churn: :changes: - :times_changed: 79 :file_path: metric_fu.gemspec - :times_changed: 30 :file_path: lib/metric_fu/base.rb - :times_changed: 26 :file_path: README - :times_changed: 23 :file_path: lib/tasks/coverage.rake - :times_changed: 23 :file_path: Rakefile - :times_changed: 22 :file_path: lib/metric_fu/churn.rb - :times_changed: 21 :file_path: lib/tasks/flog.rake - :times_changed: 19 :file_path: home_page/index.html - :times_changed: 17 :file_path: lib/metric_fu.rb - :times_changed: 16 :file_path: lib/tasks/metric_fu.rake - :times_changed: 16 :file_path: lib/metric_fu/flog.rb - :times_changed: 14 :file_path: lib/metric_fu/flay.rb - :times_changed: 13 :file_path: lib/tasks/saikuro.rake - :times_changed: 12 :file_path: lib/generators/saikuro.rb - :times_changed: 12 :file_path: spec/base_spec.rb - :times_changed: 11 :file_path: lib/generators/flog.rb - :times_changed: 10 :file_path: spec/churn_spec.rb - :times_changed: 10 :file_path: trunk/home_page/index.html - :times_changed: 10 :file_path: History.txt - :times_changed: 10 :file_path: lib/templates/awesome/rcov.html.erb - :times_changed: 9 :file_path: HISTORY - :times_changed: 9 :file_path: lib/tasks/churn.rake - :times_changed: 8 :file_path: spec/config_spec.rb - :times_changed: 8 :file_path: TODO.txt - :times_changed: 8 :file_path: lib/base/configuration.rb - :times_changed: 8 :file_path: spec/generators/flog_spec.rb - :times_changed: 8 :file_path: lib/metric_fu/flay_reporter.rb - :times_changed: 8 :file_path: lib/metric_fu/flog_reporter/base.rb - :times_changed: 8 :file_path: spec/spec_helper.rb - :times_changed: 7 :file_path: lib/metric_fu/metric_fu.rb - :times_changed: 7 :file_path: lib/templates/flog.html.erb - :times_changed: 7 :file_path: lib/metric_fu/flog_reporter/generator.rb - :times_changed: 7 :file_path: lib/metric_fu/reek.rb - :times_changed: 7 :file_path: lib/templates/awesome/reek.html.erb - :times_changed: 7 :file_path: spec/flog_spec.rb - :times_changed: 7 :file_path: lib/metric_fu/roodi.rb - :times_changed: 7 :file_path: spec/base/configuration_spec.rb - :times_changed: 6 :file_path: lib/tasks/stats.rake - :times_changed: 6 :file_path: trunk/metric_fu/tasks/metrics.rake - :times_changed: 6 :file_path: spec/generators/saikuro_spec.rb - :times_changed: 6 :file_path: lib/metric_fu/flog_reporter.rb - :times_changed: 6 :file_path: lib/templates/flog_page.html.erb - :times_changed: 6 :file_path: trunk/metric_fu/README - :times_changed: 6 :file_path: metricks.gemspec - :times_changed: 6 :file_path: lib/tasks/flay.rake - :times_changed: 6 :file_path: lib/templates/awesome/flog.html.erb - :times_changed: 6 :file_path: spec/flog_reporter/base_spec.rb - :times_changed: 6 :file_path: lib/templates/flay.html.erb - :times_changed: 6 :file_path: lib/metric_fu/flog_reporter/page.rb - :times_changed: 6 :file_path: lib/base/generator.rb - :times_changed: 5 :file_path: lib/templates/awesome/flay.html.erb - :times_changed: 5 :file_path: lib/generators/rcov.rb - :times_changed: 5 :file_path: lib/tasks/reek.rake - :times_changed: 5 :file_path: lib/templates/standard/rcov.html.erb - :times_changed: 5 :file_path: lib/tasks/roodi.rake - :times_changed: 5 :file_path: spec/flay_reporter_spec.rb - :times_changed: 5 :file_path: lib/metric_fu/saikuro.rb - :times_changed: 5 :file_path: lib/metric_fu/md5_tracker.rb - :times_changed: 5 :file_path: lib/generators/churn.rb - :times_changed: 5 :file_path: lib/templates/awesome/roodi.html.erb - :times_changed: 5 :file_path: lib/tasks/railroad.rake - :times_changed: 5 :file_path: lib/base/base_template.rb - :times_changed: 5 :file_path: spec/base/base_template_spec.rb - :times_changed: 5 :file_path: lib/templates/churn.html.erb - :times_changed: 5 :file_path: spec/flay_spec.rb :flog: :pages: - :average_score: 14.4 :path: /lib/generators/saikuro.rb :scanned_methods: - :score: 66.1 :name: Saikuro#analyze :operators: - :operator: assignment :score: 29.6 - :operator: branch :score: 15.5 - :operator: complexity :score: 9.4 - :operator: to_i :score: 8.4 - :operator: each :score: 6.8 - :operator: elements :score: 5.2 - :operator: "<<" :score: 4.8 - :operator: sort_by :score: 3.9 - :operator: name :score: 3.4 - :operator: reverse! :score: 2.6 - :operator: <=> :score: 1.9 - :operator: max :score: 1.8 - :operator: defs :score: 1.7 - :operator: new :score: 1.6 - :operator: saikuro_results :score: 1.5 - :operator: is_valid_text_file? :score: 1.4 - :operator: flatten! :score: 1.3 - :operator: reverse :score: 1.3 - :score: 44.8 :name: Saikuro::SFile#merge_classes :operators: - :operator: assignment :score: 23.1 - :operator: branch :score: 8.8 - :operator: to_i :score: 3.8 - :operator: "[]" :score: 3.7 - :operator: + :score: 3.4 - :operator: "<<" :score: 3.2 - :operator: each :score: 2.8 - :operator: lines :score: 2.1 - :operator: complexity :score: 2.1 - :operator: defs :score: 1.9 - :operator: name :score: 1.8 - :operator: sort_by :score: 1.7 - :operator: flatten :score: 1.7 - :operator: to_h :score: 1.6 - :operator: == :score: 1.6 - :operator: reverse :score: 1.5 - :operator: map :score: 1.5 - :operator: find_all :score: 1.5 - :operator: get_class_names :score: 1.5 - :score: 25.7 :name: Saikuro::SFile#get_elements :operators: - :operator: branch :score: 12.9 - :operator: assignment :score: 10.6 - :operator: "<<" :score: 5.8 - :operator: nil? :score: 5.4 - :operator: readline :score: 3.3 - :operator: match :score: 3.3 - :operator: new :score: 1.8 - :score: 25.0 :name: Saikuro#emit :operators: - :operator: assignment :score: 13.6 - :operator: branch :score: 4.0 - :operator: join :score: 3.1 - :operator: saikuro :score: 2.8 - :operator: inject :score: 2.6 - :operator: exitstatus :score: 1.8 - :operator: exit :score: 1.6 - :operator: puts :score: 1.6 - :operator: + :score: 1.4 - :operator: sh :score: 1.3 - :operator: expand_path :score: 1.3 - :operator: dirname :score: 1.3 - :operator: format_directories :score: 1.3 - :operator: lit_fixnum :score: 0.5 - :score: 21.2 :name: Saikuro::ParsingElement#initialize :operators: - :operator: assignment :score: 7.8 - :operator: match :score: 6.8 - :operator: "[]" :score: 6.0 - :operator: strip :score: 5.2 - :operator: lit_fixnum :score: 1.7 - :score: 13.5 :name: Saikuro#to_h :operators: - :operator: assignment :score: 8.5 - :operator: to_h :score: 4.3 - :operator: map :score: 3.9 - :operator: branch :score: 3.9 - :operator: filename :score: 1.5 - :score: 12.0 :name: Saikuro::ParsingElement#to_h :operators: - :operator: assignment :score: 7.6 - :operator: branch :score: 2.8 - :operator: to_i :score: 2.6 - :operator: delete :score: 1.7 - :operator: to_h :score: 1.7 - :operator: map :score: 1.5 - :operator: empty? :score: 1.3 - :score: 8.4 :name: Saikuro::SFile#get_class_names :operators: - :operator: name :score: 3.3 - :operator: branch :score: 2.7 - :operator: assignment :score: 2.7 - :operator: "<<" :score: 1.5 - :operator: include? :score: 1.4 - :operator: each :score: 1.3 - :score: 7.4 :name: Saikuro::SFile#is_valid_text_file? :operators: - :operator: branch :score: 4.1 - :operator: readline :score: 1.7 - :operator: match :score: 1.5 - :operator: eof? :score: 1.5 - :operator: assignment :score: 1.4 - :operator: open :score: 1.3 - :score: 4.7 :name: Saikuro::SFile#initialize :operators: - :operator: assignment :score: 3.9 - :operator: get_elements :score: 1.3 - :operator: open :score: 1.3 - :score: 4.7 :name: Saikuro#format_directories :operators: - :operator: saikuro :score: 1.7 - :operator: "[]" :score: 1.5 - :operator: join :score: 1.3 - :operator: assignment :score: 1.3 - :score: 2.8 :name: Saikuro::ParsingElement#<< :operators: - :operator: new :score: 1.5 - :operator: "<<" :score: 1.3 - :score: 2.8 :name: Saikuro#saikuro_results :operators: - :operator: metric_directory :score: 1.5 - :operator: glob :score: 1.3 - :score: 2.4 :name: Saikuro::ParsingElement#none :operators: - :operator: attr_accessor :score: 1.2 - :operator: attr_reader :score: 1.2 - :score: 1.3 :name: Saikuro::SFile#filename :operators: - :operator: basename :score: 1.3 - :score: 1.3 :name: Saikuro::SFile#to_h :operators: - :operator: merge_classes :score: 1.3 - :score: 1.2 :name: Saikuro::SFile#none :operators: - :operator: attr_reader :score: 1.2 :highest_score: 66.1 :score: 245.2 - :average_score: 9.7 :path: /lib/generators/flog.rb :scanned_methods: - :score: 44.1 :name: Flog#parse :operators: - :operator: assignment :score: 14.8 - :operator: branch :score: 11.1 - :operator: "[]" :score: 9.4 - :operator: scanned_methods :score: 5.9 - :operator: new :score: 4.9 - :operator: "<<" :score: 3.2 - :operator: match :score: 2.9 - :operator: split :score: 2.8 - :operator: lit_fixnum :score: 2.6 - :operator: last :score: 2.1 - :operator: operators :score: 1.9 - :operator: empty? :score: 1.7 - :operator: map :score: 1.3 - :operator: each_line :score: 1.3 - :score: 30.7 :name: Flog#emit :operators: - :operator: branch :score: 9.4 - :operator: assignment :score: 6.6 - :operator: "[]" :score: 5.6 - :operator: split :score: 4.3 - :operator: each :score: 3.1 - :operator: puts :score: 3.0 - :operator: mkdir_p :score: 1.9 - :operator: flog :score: 1.9 - :operator: directory? :score: 1.8 - :operator: join :score: 1.8 - :operator: file_changed? :score: 1.8 - :operator: glob :score: 1.8 - :operator: metric_directory :score: 1.5 - :score: 28.5 :name: Flog#to_h :operators: - :operator: assignment :score: 18.1 - :operator: branch :score: 5.4 - :operator: inject :score: 5.2 - :operator: score :score: 3.2 - :operator: + :score: 2.8 - :operator: scanned_methods :score: 1.8 - :operator: size :score: 1.6 - :operator: sort_by :score: 1.5 - :operator: to_h :score: 1.4 - :operator: reverse :score: 1.3 - :operator: average_score :score: 1.3 - :operator: map :score: 1.3 - :score: 17.6 :name: Flog#analyze :operators: - :operator: assignment :score: 7.7 - :operator: branch :score: 4.5 - :operator: sub :score: 3.6 - :operator: metric_directory :score: 2.1 - :operator: read :score: 1.8 - :operator: "<<" :score: 1.7 - :operator: open :score: 1.7 - :operator: parse :score: 1.5 - :operator: flog_results :score: 1.5 - :operator: each :score: 1.3 - :score: 9.9 :name: Flog::Page#highest_score :operators: - :operator: assignment :score: 4.2 - :operator: score :score: 3.1 - :operator: branch :score: 2.7 - :operator: inject :score: 2.6 - :operator: scanned_methods :score: 1.5 - :operator: ">" :score: 1.4 - :score: 6.9 :name: Flog::Page#to_h :operators: - :operator: to_h :score: 1.4 - :operator: assignment :score: 1.4 - :operator: map :score: 1.3 - :operator: path :score: 1.3 - :operator: average_score :score: 1.3 - :operator: highest_score :score: 1.3 - :operator: branch :score: 1.3 - :score: 5.8 :name: Flog::Page#initialize :operators: - :operator: assignment :score: 5.2 - :operator: to_f :score: 2.6 - :score: 5.8 :name: ScannedMethod#initialize :operators: - :operator: assignment :score: 5.6 - :operator: to_f :score: 1.4 - :score: 4.3 :name: Flog#average_score :operators: - :operator: / :score: 1.5 - :operator: branch :score: 1.3 - :operator: round_to_tenths :score: 1.3 - :operator: == :score: 1.3 - :score: 3.6 :name: ScannedMethod#to_h :operators: - :operator: assignment :score: 1.5 - :operator: to_h :score: 1.5 - :operator: map :score: 1.4 - :operator: branch :score: 1.4 - :score: 3.1 :name: Operator#initialize :operators: - :operator: assignment :score: 2.8 - :operator: to_f :score: 1.4 - :score: 3.0 :name: Flog#verify_dependencies! :operators: - :operator: raise :score: 1.4 - :operator: success? :score: 1.3 - :operator: branch :score: 1.3 - :score: 2.8 :name: Flog::Page#filename :operators: - :operator: path :score: 1.5 - :operator: basename :score: 1.3 - :score: 2.8 :name: Flog#flog_results :operators: - :operator: metric_directory :score: 1.5 - :operator: glob :score: 1.3 - :score: 2.4 :name: Flog#none :operators: - :operator: private :score: 1.2 - :operator: attr_reader :score: 1.2 - :score: 1.3 :name: Operator#none :operators: - :operator: attr_accessor :score: 1.3 - :score: 1.3 :name: ScannedMethod#none :operators: - :operator: attr_accessor :score: 1.3 - :score: 1.2 :name: Flog::Page#none :operators: - :operator: attr_accessor :score: 1.2 :highest_score: 44.1 :score: 175.1 - :average_score: 15.0 :path: /lib/generators/rcov.rb :scanned_methods: - :score: 73.6 :name: Rcov#analyze :operators: - :operator: assignment :score: 44.0 - :operator: branch :score: 10.2 - :operator: "[]" :score: 5.2 - :operator: + :score: 4.7 - :operator: to_f :score: 4.2 - :operator: each_pair :score: 3.9 - :operator: new :score: 3.8 - :operator: to_h :score: 3.4 - :operator: length :score: 3.4 - :operator: split :score: 2.7 - :operator: gsub :score: 2.1 - :operator: == :score: 2.0 - :operator: find_all :score: 1.9 - :operator: / :score: 1.9 - :operator: metric_directory :score: 1.9 - :operator: "*" :score: 1.7 - :operator: match :score: 1.6 - :operator: first :score: 1.6 - :operator: round :score: 1.5 - :operator: map! :score: 1.5 - :operator: open :score: 1.5 - :operator: strip :score: 1.4 - :operator: last :score: 1.4 - :operator: each_slice :score: 1.3 - :operator: shift :score: 1.3 - :operator: read :score: 1.3 - :operator: lit_fixnum :score: 0.9 - :score: 23.8 :name: Rcov#emit :operators: - :operator: "[]" :score: 5.3 - :operator: metric_directory :score: 4.9 - :operator: assignment :score: 4.5 - :operator: rcov :score: 4.0 - :operator: puts :score: 3.0 - :operator: join :score: 3.0 - :operator: branch :score: 2.7 - :operator: mkdir :score: 1.5 - :operator: rm_rf :score: 1.5 - :score: 9.5 :name: Rcov#to_h :operators: - :operator: to_f :score: 3.4 - :operator: round_to_tenths :score: 1.5 - :operator: / :score: 1.5 - :operator: "*" :score: 1.3 - :operator: merge :score: 1.3 - :operator: assignment :score: 1.3 - :operator: lit_fixnum :score: 0.4 - :score: 5.1 :name: Rcov#verify_dependencies! :operators: - :operator: raise :score: 3.0 - :operator: branch :score: 2.7 - :operator: success? :score: 1.3 - :score: 3.0 :name: Rcov#none :operators: - :operator: "*" :score: 1.4 - :operator: + :score: 1.2 - :operator: lit_fixnum :score: 0.4 - :score: 2.8 :name: Line#initialize :operators: - :operator: assignment :score: 2.8 - :score: 1.3 :name: Line#none :operators: - :operator: attr_accessor :score: 1.3 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 73.6 :score: 120.1 - :average_score: 7.7 :path: /lib/base/generator.rb :scanned_methods: - :score: 25.5 :name: Generator#none :operators: - :operator: define_method :score: 18.5 - :operator: branch :score: 4.8 - :operator: to_sym :score: 4.3 - :operator: assignment :score: 1.2 - :operator: each :score: 1.1 - :operator: attr_reader :score: 1.1 - :score: 23.7 :name: Generator#generate_report :operators: - :operator: send :score: 12.6 - :operator: to_sym :score: 4.8 - :operator: assignment :score: 3.7 - :operator: to_h :score: 1.2 - :operator: before_to_h :score: 1.2 - :operator: branch :score: 1.2 - :operator: new :score: 1.2 - :operator: generate_report :score: 1.2 - :operator: each :score: 1.2 - :score: 6.6 :name: Generator#metric_directory :operators: - :operator: scratch_directory :score: 1.4 - :operator: class :score: 1.4 - :operator: class_name :score: 1.4 - :operator: join :score: 1.2 - :operator: metric_directory :score: 1.2 - :score: 6.3 :name: Generator#initialize :operators: - :operator: class :score: 1.4 - :operator: assignment :score: 1.2 - :operator: create_data_dir_if_missing :score: 1.2 - :operator: verify_dependencies! :score: 1.2 - :operator: create_metric_dir_if_missing :score: 1.2 - :operator: create_output_dir_if_missing :score: 1.2 - :score: 6.0 :name: Generator#class_name :operators: - :operator: to_s :score: 1.8 - :operator: split :score: 1.6 - :operator: last :score: 1.4 - :operator: downcase :score: 1.2 - :score: 5.5 :name: Generator#create_output_dir_if_missing :operators: - :operator: output_directory :score: 2.9 - :operator: mkdir_p :score: 1.3 - :operator: directory? :score: 1.2 - :operator: branch :score: 1.2 - :score: 5.5 :name: Generator#create_data_dir_if_missing :operators: - :operator: data_directory :score: 2.9 - :operator: mkdir_p :score: 1.3 - :operator: directory? :score: 1.2 - :operator: branch :score: 1.2 - :score: 5.5 :name: Generator#create_metric_dir_if_missing :operators: - :operator: metric_directory :score: 2.9 - :operator: mkdir_p :score: 1.3 - :operator: branch :score: 1.2 - :operator: directory? :score: 1.2 - :score: 4.7 :name: Generator#round_to_tenths :operators: - :operator: "*" :score: 1.6 - :operator: round :score: 1.4 - :operator: / :score: 1.2 - :operator: lit_fixnum :score: 0.5 - :score: 1.2 :name: Generator#emit :operators: - :operator: raise :score: 1.2 - :score: 1.2 :name: Generator#to_graph :operators: - :operator: raise :score: 1.2 - :score: 1.2 :name: Generator#analyze :operators: - :operator: raise :score: 1.2 :highest_score: 25.5 :score: 93.0 - :average_score: 7.6 :path: /lib/base/configuration.rb :scanned_methods: - :score: 36.0 :name: Configuration#reset :operators: - :operator: assignment :score: 29.9 - :operator: join :score: 8.0 - :operator: dirname :score: 2.8 - :operator: "[]" :score: 1.4 - :operator: expand_path :score: 1.3 - :operator: set_metrics :score: 1.3 - :operator: set_graphs :score: 1.3 - :operator: branch :score: 1.3 - :operator: + :score: 1.3 - :operator: lit_fixnum :score: 1.3 - :operator: set_code_dirs :score: 1.3 - :score: 14.3 :name: Configuration#add_class_methods_to_metric_fu :operators: - :operator: module_eval :score: 7.5 - :operator: assignment :score: 4.4 - :operator: "[]" :score: 1.7 - :operator: to_sym :score: 1.5 - :operator: instance_variables :score: 1.5 - :operator: each :score: 1.3 - :operator: branch :score: 1.3 - :score: 11.0 :name: Configuration#add_attr_accessors_to_self :operators: - :operator: send :score: 4.5 - :operator: assignment :score: 2.9 - :operator: "[]" :score: 1.7 - :operator: to_sym :score: 1.5 - :operator: instance_variables :score: 1.5 - :operator: branch :score: 1.3 - :operator: each :score: 1.3 - :score: 8.9 :name: Configuration#warn_about_deprecated_config_options :operators: - :operator: raise :score: 5.6 - :operator: branch :score: 5.2 - :operator: + :score: 1.6 - :score: 5.2 :name: Configuration#initialize :operators: - :operator: warn_about_deprecated_config_options :score: 1.3 - :operator: add_attr_accessors_to_self :score: 1.3 - :operator: add_class_methods_to_metric_fu :score: 1.3 - :operator: reset :score: 1.3 - :score: 4.1 :name: Configuration#set_metrics :operators: - :operator: assignment :score: 2.8 - :operator: + :score: 1.4 - :operator: rails? :score: 1.3 - :operator: branch :score: 1.3 - :score: 3.3 :name: Configuration#set_code_dirs :operators: - :operator: assignment :score: 2.8 - :operator: rails? :score: 1.3 - :operator: branch :score: 1.3 - :score: 2.6 :name: Configuration#run :operators: - :operator: configuration :score: 1.3 - :operator: yield :score: 1.3 - :score: 1.8 :name: Configuration#rails? :operators: - :operator: exist? :score: 1.3 - :operator: assignment :score: 1.3 - :score: 1.3 :name: Configuration#set_graphs :operators: - :operator: assignment :score: 1.3 - :score: 1.3 :name: Configuration#is_cruise_control_rb? :operators: - :operator: "[]" :score: 1.3 - :score: 1.2 :name: MetricFu#configuration :operators: - :operator: new :score: 1.2 :highest_score: 36.0 :score: 91.0 - :average_score: 6.0 :path: /lib/generators/churn.rb :scanned_methods: - :score: 20.1 :name: Churn#initialize :operators: - :operator: assignment :score: 5.5 - :operator: churn :score: 5.3 - :operator: "[]" :score: 4.7 - :operator: branch :score: 4.0 - :operator: new :score: 2.9 - :operator: raise :score: 1.5 - :operator: class :score: 1.5 - :operator: exist? :score: 1.4 - :operator: git? :score: 1.3 - :operator: lit_fixnum :score: 0.4 - :score: 15.4 :name: Churn#analyze :operators: - :operator: assignment :score: 8.2 - :operator: "[]" :score: 6.0 - :operator: branch :score: 2.6 - :operator: to_a :score: 1.5 - :operator: <=> :score: 1.4 - :operator: map :score: 1.3 - :operator: sort :score: 1.3 - :operator: lit_fixnum :score: 1.3 - :score: 8.8 :name: Svn#get_logs :operators: - :operator: date_range :score: 2.0 - :operator: split :score: 1.8 - :operator: clean_up_svn_line :score: 1.7 - :operator: assignment :score: 1.7 - :operator: map :score: 1.6 - :operator: branch :score: 1.6 - :operator: compact :score: 1.4 - :score: 7.8 :name: Churn#parse_log_for_changes :operators: - :operator: assignment :score: 5.5 - :operator: branch :score: 2.7 - :operator: "[]" :score: 1.4 - :operator: get_logs :score: 1.3 - :operator: each :score: 1.3 - :operator: lit_fixnum :score: 0.8 - :score: 7.0 :name: Churn#emit :operators: - :operator: assignment :score: 5.5 - :operator: parse_log_for_changes :score: 1.5 - :operator: < :score: 1.4 - :operator: reject :score: 1.3 - :operator: branch :score: 1.3 - :score: 6.9 :name: Svn#date_range :operators: - :operator: strftime :score: 3.2 - :operator: now :score: 1.8 - :operator: parse :score: 1.6 - :operator: assignment :score: 1.6 - :operator: branch :score: 1.4 - :score: 6.6 :name: Git#get_logs :operators: - :operator: date_range :score: 1.8 - :operator: split :score: 1.6 - :operator: assignment :score: 1.5 - :operator: == :score: 1.5 - :operator: reject :score: 1.4 - :operator: branch :score: 1.4 - :score: 3.9 :name: Svn#clean_up_svn_line :operators: - :operator: "[]" :score: 1.5 - :operator: assignment :score: 1.4 - :operator: match :score: 1.4 - :operator: branch :score: 1.4 - :operator: lit_fixnum :score: 0.4 - :score: 3.8 :name: Git#date_range :operators: - :operator: parse :score: 1.6 - :operator: strftime :score: 1.6 - :operator: assignment :score: 1.6 - :operator: branch :score: 1.4 - :score: 2.6 :name: SourceControl#initialize :operators: - :operator: assignment :score: 2.6 - :score: 2.2 :name: main#none :operators: - :operator: require :score: 2.2 - :score: 1.3 :name: Svn#none :operators: - :operator: private :score: 1.3 - :score: 1.3 :name: Churn#git? :operators: - :operator: system :score: 1.3 - :score: 1.3 :name: Git#none :operators: - :operator: private :score: 1.3 - :score: 1.2 :name: Churn#none :operators: - :operator: private :score: 1.2 :highest_score: 20.1 :score: 90.3 - :average_score: 15.5 :path: /lib/graphs/reek_grapher.rb :scanned_methods: - :score: 46.6 :name: ReekGrapher#get_metrics :operators: - :operator: "[]" :score: 23.5 - :operator: reek_count :score: 9.7 - :operator: assignment :score: 7.6 - :operator: branch :score: 5.9 - :operator: nil? :score: 3.2 - :operator: labels :score: 3.0 - :operator: each :score: 2.7 - :operator: size :score: 1.3 - :operator: update :score: 1.3 - :operator: lit_fixnum :score: 0.9 - :score: 26.1 :name: ReekGrapher#graph! :operators: - :operator: assignment :score: 15.9 - :operator: output_directory :score: 1.7 - :operator: join :score: 1.5 - :operator: graph_size :score: 1.5 - :operator: reek_count :score: 1.5 - :operator: data :score: 1.4 - :operator: graph_font :score: 1.3 - :operator: write :score: 1.3 - :operator: graph_legend_box_size :score: 1.3 - :operator: graph_theme :score: 1.3 - :operator: graph_legend_font_size :score: 1.3 - :operator: labels :score: 1.3 - :operator: each_pair :score: 1.3 - :operator: branch :score: 1.3 - :operator: new :score: 1.3 - :operator: graph_title_font_size :score: 1.3 - :operator: graph_marker_font_size :score: 1.3 - :score: 2.6 :name: ReekGrapher#initialize :operators: - :operator: assignment :score: 2.6 - :score: 1.2 :name: ReekGrapher#none :operators: - :operator: attr_accessor :score: 1.2 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 46.6 :score: 77.5 - :average_score: 35.5 :path: /lib/generators/stats.rb :scanned_methods: - :score: 68.5 :name: Stats#analyze :operators: - :operator: assignment :score: 31.5 - :operator: "[]" :score: 13.0 - :operator: branch :score: 10.4 - :operator: find_all :score: 5.0 - :operator: match :score: 4.8 - :operator: shift :score: 4.1 - :operator: split :score: 4.0 - :operator: to_i :score: 3.9 - :operator: chr :score: 3.0 - :operator: empty? :score: 2.8 - :operator: map! :score: 2.8 - :operator: == :score: 2.6 - :operator: metric_directory :score: 1.8 - :operator: + :score: 1.6 - :operator: strip :score: 1.5 - :operator: each :score: 1.4 - :operator: open :score: 1.4 - :operator: lit_fixnum :score: 1.4 - :operator: pop :score: 1.2 - :operator: read :score: 1.2 - :operator: map :score: 1.2 - :operator: to_f :score: 1.2 - :score: 2.6 :name: Stats#emit :operators: - :operator: metric_directory :score: 1.4 - :operator: + :score: 1.2 :highest_score: 68.5 :score: 71.1 - :average_score: 9.8 :path: /lib/graphs/flog_grapher.rb :scanned_methods: - :score: 24.9 :name: FlogGrapher#graph! :operators: - :operator: assignment :score: 11.7 - :operator: data :score: 2.6 - :operator: output_directory :score: 1.7 - :operator: join :score: 1.5 - :operator: flog_average :score: 1.5 - :operator: flog_total :score: 1.5 - :operator: graph_size :score: 1.5 - :operator: graph_legend_box_size :score: 1.3 - :operator: graph_theme :score: 1.3 - :operator: graph_marker_font_size :score: 1.3 - :operator: write :score: 1.3 - :operator: labels :score: 1.3 - :operator: graph_font :score: 1.3 - :operator: new :score: 1.3 - :operator: graph_legend_font_size :score: 1.3 - :operator: graph_title_font_size :score: 1.3 - :score: 18.0 :name: FlogGrapher#get_metrics :operators: - :operator: "[]" :score: 6.4 - :operator: labels :score: 3.2 - :operator: push :score: 2.6 - :operator: size :score: 1.5 - :operator: flog_average :score: 1.5 - :operator: flog_total :score: 1.5 - :operator: update :score: 1.3 - :score: 3.9 :name: FlogGrapher#initialize :operators: - :operator: assignment :score: 3.9 - :score: 1.2 :name: FlogGrapher#none :operators: - :operator: attr_accessor :score: 1.2 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 24.9 :score: 49.1 - :average_score: 15.7 :path: /lib/generators/reek.rb :scanned_methods: - :score: 35.2 :name: Reek#analyze :operators: - :operator: assignment :score: 12.7 - :operator: strip :score: 6.8 - :operator: "[]" :score: 6.0 - :operator: branch :score: 5.8 - :operator: split :score: 4.3 - :operator: map :score: 4.0 - :operator: match :score: 1.8 - :operator: shift :score: 1.8 - :operator: lit_fixnum :score: 1.7 - :operator: gsub :score: 1.6 - :operator: chomp :score: 1.6 - :operator: compact :score: 1.4 - :operator: first :score: 1.4 - :score: 9.1 :name: Reek#emit :operators: - :operator: assignment :score: 3.7 - :operator: "[]" :score: 2.7 - :operator: join :score: 2.7 - :operator: reek :score: 1.6 - :operator: branch :score: 1.2 - :operator: map :score: 1.2 - :score: 2.8 :name: Reek#verify_dependencies! :operators: - :operator: raise :score: 1.3 - :operator: success? :score: 1.2 - :operator: branch :score: 1.2 :highest_score: 35.2 :score: 47.1 - :average_score: 9.4 :path: /lib/base/graph.rb :scanned_methods: - :score: 32.4 :name: Graph#generate :operators: - :operator: assignment :score: 7.4 - :operator: "[]" :score: 5.1 - :operator: each :score: 4.1 - :operator: branch :score: 4.1 - :operator: split :score: 3.8 - :operator: clazz :score: 3.2 - :operator: puts :score: 2.8 - :operator: data_directory :score: 2.1 - :operator: join :score: 1.9 - :operator: open :score: 1.7 - :operator: get_metrics :score: 1.6 - :operator: load :score: 1.5 - :operator: sort :score: 1.5 - :operator: graph! :score: 1.4 - :operator: lit_fixnum :score: 0.5 - :score: 10.6 :name: Graph#add :operators: - :operator: to_s :score: 1.7 - :operator: const_get :score: 1.7 - :operator: clazz :score: 1.5 - :operator: new :score: 1.5 - :operator: capitalize :score: 1.5 - :operator: push :score: 1.3 - :operator: assignment :score: 1.3 - :operator: + :score: 1.3 - :score: 1.7 :name: MetricFu#graph :operators: - :operator: assignment :score: 1.2 - :operator: new :score: 1.2 - :score: 1.3 :name: Graph#initialize :operators: - :operator: assignment :score: 1.3 - :score: 1.2 :name: Graph#none :operators: - :operator: attr_accessor :score: 1.2 :highest_score: 32.4 :score: 47.1 - :average_score: 9.4 :path: /lib/generators/flay.rb :scanned_methods: - :score: 26.4 :name: Flay#to_h :operators: - :operator: assignment :score: 13.7 - :operator: strip :score: 6.2 - :operator: shift :score: 3.8 - :operator: split :score: 3.4 - :operator: branch :score: 2.8 - :operator: first :score: 1.9 - :operator: "<<" :score: 1.5 - :operator: map :score: 1.5 - :operator: last :score: 1.5 - :operator: each :score: 1.3 - :operator: flatten :score: 1.3 - :score: 9.8 :name: Flay#emit :operators: - :operator: assignment :score: 4.0 - :operator: "[]" :score: 2.9 - :operator: join :score: 2.9 - :operator: flay :score: 1.7 - :operator: branch :score: 1.3 - :operator: map :score: 1.3 - :score: 6.6 :name: Flay#analyze :operators: - :operator: split :score: 2.9 - :operator: assignment :score: 2.7 - :operator: chomp :score: 1.7 - :operator: map :score: 1.3 - :operator: branch :score: 1.3 - :score: 3.0 :name: Flay#verify_dependencies! :operators: - :operator: raise :score: 1.4 - :operator: success? :score: 1.3 - :operator: branch :score: 1.3 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 26.4 :score: 46.9 - :average_score: 4.2 :path: /lib/base/base_template.rb :scanned_methods: - :score: 8.6 :name: Template#file_url :operators: - :operator: branch :score: 2.7 - :operator: configuration :score: 1.6 - :operator: gsub :score: 1.4 - :operator: platform :score: 1.4 - :operator: "<<" :score: 1.3 - :operator: expand_path :score: 1.2 - :operator: assignment :score: 1.2 - :operator: include? :score: 1.2 - :score: 7.9 :name: Template#erbify :operators: - :operator: template :score: 1.4 - :operator: new :score: 1.4 - :operator: binding :score: 1.4 - :operator: assignment :score: 1.2 - :operator: read :score: 1.2 - :operator: result :score: 1.2 - :operator: require :score: 1.2 - :score: 5.8 :name: Template#inline_css :operators: - :operator: this_directory :score: 1.6 - :operator: join :score: 1.4 - :operator: assignment :score: 1.3 - :operator: read :score: 1.3 - :operator: branch :score: 1.2 - :operator: open :score: 1.2 - :score: 5.6 :name: Template#template :operators: - :operator: to_s :score: 1.6 - :operator: + :score: 1.4 - :operator: this_directory :score: 1.4 - :operator: join :score: 1.2 - :score: 3.5 :name: Template#link_content :operators: - :operator: branch :score: 2.5 - :operator: assignment :score: 2.4 - :score: 3.4 :name: Template#link_to_filename :operators: - :operator: assignment :score: 2.4 - :operator: link_content :score: 1.2 - :operator: file_url :score: 1.2 - :score: 3.2 :name: Template#cycle :operators: - :operator: "%" :score: 1.4 - :operator: branch :score: 1.2 - :operator: == :score: 1.2 - :operator: lit_fixnum :score: 0.4 - :score: 2.6 :name: Template#template_exists? :operators: - :operator: template :score: 1.4 - :operator: exist? :score: 1.2 - :score: 2.6 :name: Template#output_filename :operators: - :operator: to_s :score: 1.4 - :operator: + :score: 1.2 - :score: 2.2 :name: Template#none :operators: - :operator: attr_accessor :score: 1.1 - :operator: private :score: 1.1 - :score: 1.2 :name: Template#create_instance_var :operators: - :operator: instance_variable_set :score: 1.2 :highest_score: 8.6 :score: 46.6 - :average_score: 21.2 :path: /lib/metric_fu.rb :scanned_methods: - :score: 41.2 :name: main#none :operators: - :operator: join :score: 17.1 - :operator: assignment :score: 10.4 - :operator: require :score: 9.3 - :operator: "[]" :score: 6.5 - :operator: branch :score: 5.5 - :operator: each :score: 5.5 - :operator: load :score: 1.1 - :score: 1.1 :name: MetricFu#none :operators: - :operator: dirname :score: 1.1 :highest_score: 41.2 :score: 42.3 - :average_score: 8.3 :path: /lib/graphs/flay_grapher.rb :scanned_methods: - :score: 22.5 :name: FlayGrapher#graph! :operators: - :operator: assignment :score: 11.7 - :operator: output_directory :score: 1.7 - :operator: graph_size :score: 1.5 - :operator: join :score: 1.5 - :operator: flay_score :score: 1.5 - :operator: graph_legend_font_size :score: 1.3 - :operator: graph_marker_font_size :score: 1.3 - :operator: data :score: 1.3 - :operator: graph_title_font_size :score: 1.3 - :operator: write :score: 1.3 - :operator: labels :score: 1.3 - :operator: graph_theme :score: 1.3 - :operator: graph_legend_box_size :score: 1.3 - :operator: new :score: 1.3 - :operator: graph_font :score: 1.3 - :score: 13.9 :name: FlayGrapher#get_metrics :operators: - :operator: "[]" :score: 3.6 - :operator: labels :score: 3.2 - :operator: flay_score :score: 1.5 - :operator: size :score: 1.5 - :operator: to_i :score: 1.5 - :operator: update :score: 1.3 - :operator: push :score: 1.3 - :score: 2.6 :name: FlayGrapher#initialize :operators: - :operator: assignment :score: 2.6 - :score: 1.2 :name: FlayGrapher#none :operators: - :operator: attr_accessor :score: 1.2 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 22.5 :score: 41.3 - :average_score: 8.3 :path: /lib/graphs/roodi_grapher.rb :scanned_methods: - :score: 22.5 :name: RoodiGrapher#graph! :operators: - :operator: assignment :score: 11.7 - :operator: output_directory :score: 1.7 - :operator: graph_size :score: 1.5 - :operator: join :score: 1.5 - :operator: roodi_count :score: 1.5 - :operator: graph_legend_font_size :score: 1.3 - :operator: graph_marker_font_size :score: 1.3 - :operator: data :score: 1.3 - :operator: graph_title_font_size :score: 1.3 - :operator: write :score: 1.3 - :operator: labels :score: 1.3 - :operator: graph_theme :score: 1.3 - :operator: graph_legend_box_size :score: 1.3 - :operator: new :score: 1.3 - :operator: graph_font :score: 1.3 - :score: 13.9 :name: RoodiGrapher#get_metrics :operators: - :operator: "[]" :score: 3.6 - :operator: labels :score: 3.2 - :operator: size :score: 3.0 - :operator: roodi_count :score: 1.5 - :operator: push :score: 1.3 - :operator: update :score: 1.3 - :score: 2.6 :name: RoodiGrapher#initialize :operators: - :operator: assignment :score: 2.6 - :score: 1.2 :name: RoodiGrapher#none :operators: - :operator: attr_accessor :score: 1.2 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 22.5 :score: 41.3 - :average_score: 7.9 :path: /lib/graphs/rcov_grapher.rb :scanned_methods: - :score: 22.5 :name: RcovGrapher#graph! :operators: - :operator: assignment :score: 11.7 - :operator: output_directory :score: 1.7 - :operator: graph_size :score: 1.5 - :operator: join :score: 1.5 - :operator: rcov_percent :score: 1.5 - :operator: graph_legend_font_size :score: 1.3 - :operator: graph_marker_font_size :score: 1.3 - :operator: data :score: 1.3 - :operator: graph_title_font_size :score: 1.3 - :operator: write :score: 1.3 - :operator: labels :score: 1.3 - :operator: graph_theme :score: 1.3 - :operator: graph_legend_box_size :score: 1.3 - :operator: new :score: 1.3 - :operator: graph_font :score: 1.3 - :score: 12.0 :name: RcovGrapher#get_metrics :operators: - :operator: "[]" :score: 3.2 - :operator: labels :score: 3.2 - :operator: size :score: 1.5 - :operator: rcov_percent :score: 1.5 - :operator: push :score: 1.3 - :operator: update :score: 1.3 - :score: 2.6 :name: RcovGrapher#initialize :operators: - :operator: assignment :score: 2.6 - :score: 1.2 :name: RcovGrapher#none :operators: - :operator: attr_accessor :score: 1.2 - :score: 1.1 :name: main#none :operators: - :operator: require :score: 1.1 :highest_score: 22.5 :score: 39.4 - :average_score: 4.5 :path: /lib/base/report.rb :scanned_methods: - :score: 8.9 :name: Report#add :operators: - :operator: to_s :score: 1.7 - :operator: report_hash :score: 1.5 - :operator: generate_report :score: 1.5 - :operator: capitalize :score: 1.5 - :operator: const_get :score: 1.3 - :operator: merge! :score: 1.3 - :operator: assignment :score: 1.3 - :score: 7.9 :name: Report#open_in_browser? :operators: - :operator: configuration :score: 3.4 - :operator: platform :score: 1.6 - :operator: is_cruise_control_rb? :score: 1.4 - :operator: include? :score: 1.4 - :operator: branch :score: 1.3 - :score: 6.0 :name: Report#save_templatized_report :operators: - :operator: assignment :score: 2.6 - :operator: template_class :score: 1.5 - :operator: write :score: 1.3 - :operator: report_hash :score: 1.3 - :operator: new :score: 1.3 - :score: 4.0 :name: Report#save_output :operators: - :operator: assignment :score: 2.7 - :operator: puts :score: 1.4 - :operator: branch :score: 1.3 - :operator: open :score: 1.3 - :score: 3.0 :name: Report#show_in_browser :operators: - :operator: system :score: 1.4 - :operator: open_in_browser? :score: 1.3 - :operator: branch :score: 1.3 - :score: 2.8 :name: Report#to_yaml :operators: - :operator: report_hash :score: 1.5 - :operator: to_yaml :score: 1.3 - :score: 1.7 :name: MetricFu#report :operators: - :operator: assignment :score: 1.2 - :operator: new :score: 1.2 - :score: 1.3 :name: Report#report_hash :operators: - :operator: assignment :score: 1.3 :highest_score: 8.9 :score: 35.6 - :average_score: 16.8 :path: /lib/templates/awesome/awesome_template.rb :scanned_methods: - :score: 32.3 :name: AwesomeTemplate#write :operators: - :operator: assignment :score: 13.8 - :operator: erbify :score: 5.8 - :operator: report :score: 4.7 - :operator: branch :score: 3.7 - :operator: output_directory :score: 3.3 - :operator: save_output :score: 2.9 - :operator: output_filename :score: 2.9 - :operator: template_exists? :score: 2.5 - :operator: pwd :score: 1.6 - :operator: create_instance_var :score: 1.5 - :operator: basename :score: 1.4 - :operator: each_pair :score: 1.2 - :operator: gsub :score: 1.2 - :score: 1.2 :name: AwesomeTemplate#this_directory :operators: - :operator: dirname :score: 1.2 :highest_score: 32.3 :score: 33.5 - :average_score: 10.7 :path: /lib/generators/roodi.rb :scanned_methods: - :score: 20.4 :name: Roodi#analyze :operators: - :operator: assignment :score: 13.1 - :operator: split :score: 4.1 - :operator: branch :score: 3.6 - :operator: "[]" :score: 3.0 - :operator: chomp :score: 1.6 - :operator: empty? :score: 1.3 - :operator: map! :score: 1.2 - :operator: pop :score: 1.2 - :operator: reject! :score: 1.2 - :operator: map :score: 1.2 - :operator: lit_fixnum :score: 0.4 - :score: 9.1 :name: Roodi#emit :operators: - :operator: assignment :score: 3.7 - :operator: "[]" :score: 2.7 - :operator: join :score: 2.7 - :operator: roodi :score: 1.6 - :operator: branch :score: 1.2 - :operator: map :score: 1.2 - :score: 2.8 :name: Roodi#verify_dependencies! :operators: - :operator: raise :score: 1.3 - :operator: success? :score: 1.2 - :operator: branch :score: 1.2 :highest_score: 20.4 :score: 32.2 - :average_score: 12.7 :path: /lib/templates/standard/standard_template.rb :scanned_methods: - :score: 24.2 :name: StandardTemplate#write :operators: - :operator: assignment :score: 9.7 - :operator: report :score: 4.7 - :operator: branch :score: 3.7 - :operator: output_directory :score: 3.3 - :operator: erbify :score: 2.9 - :operator: output_filename :score: 2.9 - :operator: save_output :score: 2.9 - :operator: template_exists? :score: 2.5 - :operator: create_instance_var :score: 1.5 - :operator: each_pair :score: 1.2 - :score: 1.2 :name: StandardTemplate#this_directory :operators: - :operator: dirname :score: 1.2 :highest_score: 24.2 :score: 25.4 :average: 9.9 :total: 1491.1 :stats: :codeLOC: 15935 :testLOC: 7438 :lines: - :methods_per_class: 7 :methods: 722 :loc_per_method: 7 :classes: 98 :lines: 8796 :name: Controllers :loc: 7184 - :methods_per_class: 0 :methods: 135 :loc_per_method: 8 :classes: 0 :lines: 1800 :name: Helpers :loc: 1413 - :methods_per_class: 5 :methods: 491 :loc_per_method: 6 :classes: 95 :lines: 5571 :name: Models :loc: 4033 - :methods_per_class: 6 :methods: 305 :loc_per_method: 8 :classes: 49 :lines: 4108 :name: Libraries :loc: 3305 - :methods_per_class: 0 :methods: 4 :loc_per_method: 876 :classes: 0 :lines: 4386 :name: Model specs :loc: 3514 - :methods_per_class: 4 :methods: 8 :loc_per_method: 390 :classes: 2 :lines: 3895 :name: Controller specs :loc: 3137 - :methods_per_class: 0 :methods: 0 :loc_per_method: 0 :classes: 0 :lines: 326 :name: Helper specs :loc: 258 - :methods_per_class: 0 :methods: 2 :loc_per_method: 262 :classes: 0 :lines: 649 :name: Library specs :loc: 529 - :methods_per_class: 6 :methods: 1667 :loc_per_method: 12 :classes: 244 :lines: 29531 :name: Total :loc: 23373 :code_to_test_ratio: 0.5 :rails_best_practices: :problems: - :line: "17" :file: ./app/views/admin/testimonials/_form.html.erb :problem: replace instance variable with local variable - :line: "24,45,68,85" :file: ./app/controllers/admin/campaigns_controller.rb :problem: use before_filter for show,edit,update,destroy :total: - Found 2 errors.