Class: AnalDiffist::FlogParser

Inherits:
Object
  • Object
show all
Defined in:
lib/analdiffist/flog_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(paths, threshold = 10.0) ⇒ FlogParser

Returns a new instance of FlogParser.



4
5
6
7
# File 'lib/analdiffist/flog_parser.rb', line 4

def initialize paths, threshold = 10.0
  @paths = paths
  @flog_threshold = threshold
end

Instance Method Details

#problemsObject



9
10
11
12
13
14
15
16
17
# File 'lib/analdiffist/flog_parser.rb', line 9

def problems
  f = Flog.new :continue => true

  f.flog(@paths)
  problems = []
  f.each_by_score{|class_method, score, ignore_for_now| problems << FlogProblem.new(class_method, score, @flog_threshold)}
  problems
  #problems.select {|p| p.score >= @flog_threshold}
end