Class: RubyCritic::Analyser::FlogSmells

Inherits:
Object
  • Object
show all
Includes:
Colorize
Defined in:
lib/rubycritic/analysers/smells/flog.rb

Constant Summary collapse

HIGH_COMPLEXITY_SCORE_THRESHOLD =
25
VERY_HIGH_COMPLEXITY_SCORE_THRESHOLD =
60

Instance Method Summary collapse

Methods included from Colorize

#colorize, #green, #red

Constructor Details

#initialize(analysed_modules) ⇒ FlogSmells

Returns a new instance of FlogSmells.


14
15
16
17
# File 'lib/rubycritic/analysers/smells/flog.rb', line 14

def initialize(analysed_modules)
  @flog = Flog.new
  @analysed_modules = analysed_modules
end

Instance Method Details

#runObject


19
20
21
22
23
24
25
# File 'lib/rubycritic/analysers/smells/flog.rb', line 19

def run
  @analysed_modules.each do |analysed_module|
    add_smells_to(analysed_module)
    print green '.'
  end
  puts ''
end

#to_sObject


27
28
29
# File 'lib/rubycritic/analysers/smells/flog.rb', line 27

def to_s
  'flog smells'
end