Skip to content

Commit

Permalink
Masked smells can now be reported more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrutherford committed Jun 17, 2009
1 parent 41acc2a commit 63233bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/reek/report.rb
Expand Up @@ -7,7 +7,7 @@ class Report
include Enumerable

def initialize(sniffer = nil) # :nodoc:
@masked_smells = 0
@masked_smells = SortedSet.new
@report = SortedSet.new
sniffer.report_on(self) if sniffer
end
Expand All @@ -25,11 +25,11 @@ def <<(smell) # :nodoc:
end

def record_masked_smell(smell)
@masked_smells += 1
@masked_smells << smell
end

def num_masked_smells
@masked_smells
@masked_smells.length
end

def empty?
Expand Down Expand Up @@ -57,7 +57,7 @@ def full_report(desc)
def header(desc, num_smells)
result = "\"#{desc}\" -- #{num_smells} warning"
result += 's' unless num_smells == 1
result += " (+#{@masked_smells} masked)" if @masked_smells > 0
result += " (+#{@masked_smells.length} masked)" unless @masked_smells.empty?
result
end

Expand Down

0 comments on commit 63233bb

Please sign in to comment.