Sha256: 71a695b0db62ac9a1882a4f30aa9754ede0850e926e053da8af7e196107b5149
Contents?: true
Size: 805 Bytes
Versions: 11
Compression:
Stored size: 805 Bytes
Contents
module MetricFu::FlogReporter class Page attr_accessor :score, :scanned_methods def initialize(score, scanned_methods = []) @score = score.to_f @scanned_methods = scanned_methods end def to_html output = "<html><head><style>" output << Base.load_css output << "</style></head><body>" output << "Score: #{score}\n" scanned_methods.each do |sm| output << sm.to_html end output << "</body></html>" output end def average_score sum = 0 scanned_methods.each do |m| sum += m.score end sum / scanned_methods.length end def highest_score scanned_methods.inject(0) do |highest, m| m.score > highest ? m.score : highest end end end end
Version data entries
11 entries across 11 versions & 4 rubygems