summary with brakeman links

This commit is contained in:
Miguel Savignano 2019-11-01 20:56:20 +01:00
parent 5e973bd2f9
commit 87c9d43dfb

View File

@ -13,7 +13,7 @@ class ReportAdapter
end
def summary(report)
"**Brakeman Report**: \n - #{security_warnings(report)} security warnings"
"**Brakeman Report**: \n - #{security_warnings(report)} security warnings\n #{check_table(report)}"
end
def annotations(report)
@ -31,6 +31,14 @@ class ReportAdapter
private
def check_table(report)
uniq_checks(report).reduce('') { |memo, check| memo + " - [#{check[:check_name]}](#{check[:link]})" }
end
def uniq_checks(report)
report['warnings'].map { |w| { check_name: w['check_name'], link: w['link'] } }.uniq { |w| w[:checkname] }
end
def security_warnings(report)
report['scan_info']['security_warnings']
end