lib/brakeman/report/report_text.rb in brakeman-lib-4.7.0 vs lib/brakeman/report/report_text.rb in brakeman-lib-4.7.1

- old
+ new

@@ -17,11 +17,11 @@ end add_chunk generate_controllers if tracker.options[:debug] or tracker.options[:report_routes] add_chunk generate_templates if tracker.options[:debug] add_chunk generate_obsolete - add_chunk generate_errors + add_chunk generate_errors add_chunk generate_warnings end def add_chunk chunk, out = @output_string if chunk and not chunk.empty? @@ -49,11 +49,11 @@ } end def generate_header [ - header("Brakeman Report"), + header("Brakeman Report"), label("Application Path", tracker.app_path), label("Rails Version", rails_version), label("Brakeman Version", Brakeman::Version), label("Scan Date", tracker.start_time), label("Duration", "#{tracker.duration} seconds"), @@ -90,11 +90,11 @@ def generate_warnings if tracker.filtered_warnings.empty? HighLine.color("No warnings found", :bold, :green) else warnings = tracker.filtered_warnings.sort_by do |w| - [w.confidence, w.warning_type, w.fingerprint] + [w.confidence, w.warning_type, w.file, w.line, w.fingerprint] end.map do |w| output_warning w end double_space "Warnings", warnings @@ -138,11 +138,11 @@ template_rows[name] << out.gsub("\n", ";").gsub(/\s+/, " ") end end double_space "Template Output", template_rows.sort_by { |name, value| name.to_s }.map { |template| - [HighLine.new.color(template.first.to_s << "\n", :cyan)] + template[1] + [HighLine.new.color("#{template.first}\n", :cyan)] + template[1] }.compact end def output_warning w out = [ @@ -209,6 +209,5 @@ end double_space "Controller Overview", controllers end end -