Module: RubyCritic::Reporter

Defined in:
lib/rubycritic/reporter.rb

Class Method Summary collapse

Class Method Details

.generate_report(analysed_modules) ⇒ Object



5
6
7
# File 'lib/rubycritic/reporter.rb', line 5

def self.generate_report(analysed_modules)
  report_generator_class.new(analysed_modules).generate_report
end

.report_generator_classObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rubycritic/reporter.rb', line 9

def self.report_generator_class
  case Config.format
  when :json
    require 'rubycritic/generators/json_report'
    Generator::JsonReport
  when :console
    require 'rubycritic/generators/console_report'
    Generator::ConsoleReport
  when :lint
    require 'rubycritic/generators/lint_report'
    Generator::LintReport
  else
    require 'rubycritic/generators/html_report'
    Generator::HtmlReport
  end
end