class Reek::Report::TextReport
Generates a sorted, text summary of smells in examiners
@public
Public Class Methods
Source
# File lib/reek/report/text_report.rb, line 14 def initialize(**args) super print progress_formatter.header end
@public
Calls superclass method
Reek::Report::BaseReport::new
Public Instance Methods
Source
# File lib/reek/report/text_report.rb, line 21 def add_examiner(examiner) print progress_formatter.progress examiner super end
@public
Calls superclass method
Reek::Report::BaseReport#add_examiner
Source
# File lib/reek/report/text_report.rb, line 27 def show sort_examiners if smells? print progress_formatter.footer display_summary display_total_smell_count end
@public
Private Instance Methods
Source
# File lib/reek/report/text_report.rb, line 40 def display_summary smell_summaries.each { |smell| puts smell } end
Source
# File lib/reek/report/text_report.rb, line 44 def display_total_smell_count return unless examiners.size > 1 print total_smell_count_message end
Source
# File lib/reek/report/text_report.rb, line 36 def smell_summaries examiners.map { |ex| summarize_single_examiner(ex) }.reject(&:empty?) end
Source
# File lib/reek/report/text_report.rb, line 59 def sort_examiners examiners.sort_by!(&:smells_count).reverse! if sort_by_issue_count end
Source
# File lib/reek/report/text_report.rb, line 50 def summarize_single_examiner(examiner) result = heading_formatter.header(examiner) if examiner.smelly? formatted_list = warning_formatter.format_list(examiner.smells) result += ":\n#{formatted_list}" end result end
Source
# File lib/reek/report/text_report.rb, line 63 def total_smell_count_message colour = smells? ? WARNINGS_COLOR : NO_WARNINGS_COLOR Rainbow("#{total_smell_count} total warning#{total_smell_count == 1 ? '' : 's'}\n").color(colour) end