class ZombieScout::Formatter::ReportFormatter

Public Instance Methods

to_s() click to toggle source
# File lib/zombie_scout/formatter.rb, line 20
def to_s
  one = "Scouted #{mission.defined_method_count} methods in #{mission.source_count} files, in #{mission.duration} seconds."
  two = "Found #{mission.zombie_count} potential zombies, with a combined flog score of #{total_flog_score.round(1)}."

  ([one, two, "\n"] + report.map { |zombie|
    [zombie[:location], zombie[:full_name], zombie[:flog_score]] * "\t"
  }) * "\n"
end
total_flog_score() click to toggle source
# File lib/zombie_scout/formatter.rb, line 29
def total_flog_score
  report.map { |z| z[:flog_score] }.reduce(0, :+)
end