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.



6
7
8
9
10
# File 'lib/cc/cli/analyze.rb', line 6

def initialize(_args = [])
  super

  process_args
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cc/cli/analyze.rb', line 12

def run
  require_codeclimate_yml

  runner = EnginesRunner.new(registry, formatter, source_dir, config)
  runner.run

rescue EnginesRunner::InvalidEngineName => ex
  fatal(ex.message)
rescue EnginesRunner::NoEnabledEngines
  fatal("No enabled engines. Add some to your .codeclimate.yml file!")
end