Class: SecurityReport::PlainReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/security_report/plain_reporter.rb

Instance Method Summary collapse

Instance Method Details

#report(results, skipped) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/security_report/plain_reporter.rb', line 3

def report(results, skipped)
  if results.any?
    high, medium_or_lower = results.partition { |result| result.criticality == :high }
    medium, low_or_unknown = medium_or_lower.partition { |result| result.criticality == :medium }

    puts format_results(high) if high.any?
    puts format_results(medium) if medium.any?
    puts format_results(low_or_unknown) if low_or_unknown.any?
  else
    puts "No vulnerabilities found"
  end

  if skipped.any?
    puts
    puts "Skipped #{skipped.join(", ")}: No Gemfile.lock found"
  end
end