Class: RubyCritic::AnalysersRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/analysers_runner.rb

Constant Summary collapse

ANALYSERS =
[
  Analyser::FlaySmells,
  Analyser::FlogSmells,
  Analyser::ReekSmells,
  Analyser::Complexity,
  Analyser::Attributes,
  Analyser::Churn
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ AnalysersRunner

Returns a new instance of AnalysersRunner.


21
22
23
# File 'lib/rubycritic/analysers_runner.rb', line 21

def initialize(paths)
  @paths = paths
end

Instance Method Details

#analysed_modulesObject


34
35
36
# File 'lib/rubycritic/analysers_runner.rb', line 34

def analysed_modules
  @analysed_modules ||= AnalysedModulesCollection.new(@paths)
end

#runObject


25
26
27
28
29
30
31
32
# File 'lib/rubycritic/analysers_runner.rb', line 25

def run
  ANALYSERS.each do |analyser_class|
    analyser_instance = analyser_class.new(analysed_modules)
    puts "running #{analyser_instance}"
    analyser_instance.run
  end
  analysed_modules
end