Sha256: 29d5df76cde09c6080eb754715bae9e33eafd7335662c9e099e76d2b6b0b0aa4
Contents?: true
Size: 994 Bytes
Versions: 19
Compression:
Stored size: 994 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
19 entries across 19 versions & 1 rubygems