Sha256: 0be8a427c709c2d4b1c45b5179337f522bc4a754e1e0a3944bc0e1e4da535c3d
Contents?: true
Size: 1.31 KB
Versions: 52
Compression:
Stored size: 1.31 KB
Contents
class Brakeman::Report::JSON < Brakeman::Report::Base def generate_report errors = tracker.errors.map{|e| { :error => e[:error], :location => e[:backtrace][0] }} obsolete = tracker.unused_fingerprints warnings = convert_to_hashes all_warnings ignored = convert_to_hashes ignored_warnings scan_info = { :app_path => tracker.app_path, :rails_version => rails_version, :security_warnings => all_warnings.length, :start_time => tracker.start_time.to_s, :end_time => tracker.end_time.to_s, :duration => tracker.duration, :checks_performed => checks.checks_run.sort, :number_of_controllers => tracker.controllers.length, # ignore the "fake" model :number_of_models => tracker.models.length - 1, :number_of_templates => number_of_templates(@tracker), :ruby_version => RUBY_VERSION, :brakeman_version => Brakeman::Version } report_info = { :scan_info => scan_info, :warnings => warnings, :ignored_warnings => ignored, :errors => errors, :obsolete => obsolete } JSON.pretty_generate report_info end def convert_to_hashes warnings warnings.map do |w| hash = w.to_hash hash[:file] = warning_file w hash end.sort_by { |w| "#{w[:fingerprint]}#{w[:line]}" } end end
Version data entries
52 entries across 52 versions & 3 rubygems