Sha256: 82da0371c92581eaccf4d7899e19001a83143980e14cbf1179b9889ec37a4f5b
Contents?: true
Size: 877 Bytes
Versions: 3
Compression:
Stored size: 877 Bytes
Contents
require "rubycritic/smell" module Rubycritic module SmellAdapter class Flog def initialize(flog) @flog = flog end def smells smells = [] @flog.each_by_score do |class_method, score| smells << create_smell(class_method, score) end smells end private def create_smell(context, score) location = method_location(context) message = "has a complexity of #{score.round}" Smell.new( :locations => [location], :context => context, :message => message, :score => score, :type => "Complexity" ) end def method_location(context) line = @flog.method_locations[context] file_path, file_line = line.split(":") Location.new(file_path, file_line) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubycritic-0.0.6 | lib/rubycritic/smell_adapters/flog.rb |
rubycritic-0.0.5 | lib/rubycritic/smell_adapters/flog.rb |
rubycritic-0.0.4 | lib/rubycritic/smell_adapters/flog.rb |