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 }

    [high, medium, low_or_unknown].each do |results|
      puts format_results(results) if results.any?
    end
  else
    puts "No vulnerabilities found"
  end

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