Class: Hone::FindingFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/hone/finding_filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(findings, options = {}) ⇒ FindingFilter

Returns a new instance of FindingFilter.



8
9
10
11
12
13
14
15
16
# File 'lib/hone/finding_filter.rb', line 8

def initialize(findings, options = {})
  @findings = findings
  @diff = options[:diff]
  @baseline = options[:baseline]
  @hot_only = options[:hot_only]
  @show_cold = options[:show_cold]
  @profile_path = options[:profile_path]
  @top = options[:top]
end

Instance Method Details

#applyObject



18
19
20
21
22
23
24
# File 'lib/hone/finding_filter.rb', line 18

def apply
  filtered = @findings
  filtered = filter_by_diff(filtered) if @diff
  filtered = filter_by_baseline(filtered) if @baseline
  filtered = filter_by_priority(filtered)
  apply_top_limit(filtered)
end