Class: CC::CLI::Analyze

Inherits:
Command show all
Includes:
Analyzer
Defined in:
lib/cc/cli/analyze.rb

Constant Summary

Constants inherited from Command

Command::CODECLIMATE_YAML

Instance Method Summary collapse

Methods inherited from Command

command_name, #execute, #fatal, #require_codeclimate_yml, #say, #warn

Constructor Details

#initialize(args = []) ⇒ Analyze

Returns a new instance of Analyze.



8
9
10
11
12
# File 'lib/cc/cli/analyze.rb', line 8

def initialize(args = [])
  super

  process_args
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cc/cli/analyze.rb', line 14

def run
  require_codeclimate_yml
  if engines.empty?
    fatal("No engines enabled. Add some to your .codeclimate.yml file!")
  end

  formatter.started

  engines.each do |engine|
    formatter.engine_running(engine) do
      engine.run(formatter)
    end
  end

  formatter.finished
end