class Rubycritic::SmellAdapter::Flog

def create_smell(context, score)

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 initialize(flog)

def initialize(flog)
  @flog = flog
end

def method_location(context)

def method_location(context)
  line = @flog.method_locations[context]
  file_path, file_line = line.split(":")
  Location.new(file_path, file_line)
end

def smells

def smells
  smells = []
  @flog.each_by_score do |class_method, score|
    smells << create_smell(class_method, score)
  end
  smells
end