class Reek::CLI::Command::ReportCommand
A command to collect smells from a set of sources and write them out in text report format.
Public Instance Methods
Source
# File lib/reek/cli/command/report_command.rb, line 16 def execute populate_reporter_with_smells reporter.show result_code end
Private Instance Methods
Source
# File lib/reek/cli/command/report_command.rb, line 62 def heading_formatter Report.heading_formatter(options.show_empty ? :verbose : :quiet) end
Source
# File lib/reek/cli/command/report_command.rb, line 58 def location_formatter Report.location_formatter(options.location_format) end
Source
# File lib/reek/cli/command/report_command.rb, line 24 def populate_reporter_with_smells sources.each do |source| reporter.add_examiner Examiner.new(source, filter_by_smells: smell_names, configuration: configuration, error_handler: LoggingErrorHandler.new) end end
Source
# File lib/reek/cli/command/report_command.rb, line 66 def progress_formatter Report.progress_formatter(options.progress_format) end
Source
# File lib/reek/cli/command/report_command.rb, line 46 def report_class Report.report_class(options.report_format) end
Source
# File lib/reek/cli/command/report_command.rb, line 37 def reporter @reporter ||= report_class.new( warning_formatter: warning_formatter, sort_by_issue_count: sort_by_issue_count, heading_formatter: heading_formatter, progress_formatter: progress_formatter.new(sources.length)) end
Source
# File lib/reek/cli/command/report_command.rb, line 33 def result_code reporter.smells? ? options.failure_exit_code : options.success_exit_code end
Source
# File lib/reek/cli/command/report_command.rb, line 70 def sort_by_issue_count options.sorting == :smelliness end
Source
# File lib/reek/cli/command/report_command.rb, line 50 def warning_formatter warning_formatter_class.new(location_formatter: location_formatter) end
Source
# File lib/reek/cli/command/report_command.rb, line 54 def warning_formatter_class Report.warning_formatter_class(options.show_links ? :documentation_links : :simple) end