Sha256: c4fef16558539fc3123f9ef477d477cda3df803f65d146b84c4155a0cf83b899
Contents?: true
Size: 995 Bytes
Versions: 9
Compression:
Stored size: 995 Bytes
Contents
class MetricFu::FlogHotspot < MetricFu::Hotspot COLUMNS = %w{score} def columns COLUMNS end def name :flog end def map_strategy :score end def reduce_strategy :average end def score_strategy :identity end def generate_records(data, table) return if data == nil Array(data[:method_containers]).each do |method_container| Array(method_container[:methods]).each do |entry| file_path = entry[1][:path].sub(%r{^/}, "") if entry[1][:path] location = MetricFu::Location.for(entry.first) table << { "metric" => name, "score" => entry[1][:score], "file_path" => file_path, "class_name" => location.class_name, "method_name" => location.method_name } end end end def present_group(group) occurences = group.size complexity = get_mean(group.column("score")) "#{'average ' if occurences > 1}complexity is %.1f" % complexity end end
Version data entries
9 entries across 9 versions & 3 rubygems