提交 3403a9bf 编写于 作者: O Owen Davies

Fixed html report to match default report

上级 3308b117
......@@ -88,10 +88,10 @@ class Brakeman::Report
types = warnings_summary.keys
types.delete :high_confidence
if html
load_and_render_erb('warning_overview', binding)
else
unless types.empty?
unless types.empty?
if html
load_and_render_erb('warning_overview', binding)
else
Terminal::Table.new(:headings => ['Warning Type', 'Total']) do |t|
types.sort.each do |warning_type|
t.add_row [warning_type, warnings_summary[warning_type]]
......@@ -139,10 +139,10 @@ class Brakeman::Report
stabilizer = 0
warning_messages = warning_messages.sort_by{|row| stabilizer += 1; [row['Confidence'], row['Warning Type'], row['Class'], stabilizer]}
if html
load_and_render_erb('security_warnings', binding)
else
unless warning_messages.empty?
unless warning_messages.empty?
if html
load_and_render_erb('security_warnings', binding)
else
Terminal::Table.new(:headings => ["Confidence", "Class", "Method", "Warning Type", "Message"]) do |t|
warning_messages.each do |row|
t.add_row [row["Confidence"], row["Class"], row["Method"], row["Warning Type"], row["Message"]]
......@@ -353,7 +353,7 @@ class Brakeman::Report
def to_html
out = html_header <<
generate_overview(true) <<
generate_warning_overview(true)
generate_warning_overview(true).to_s
# Return early if only summarizing
if tracker.options[:summary_only]
......
<h2>Security Warnings</h2>
<table>
<% if warning_messages.any? %>
<tr>
<th>Confidence</th>
<th>Class</th>
......@@ -17,12 +16,4 @@
<td><%= warning['Message']%></td>
</tr>
<% end %>
<% else %>
<tr>
<th>General Warnings</th>
</tr>
<tr>
<td>[NONE]</td>
</tr>
<% end %>
</table>
\ No newline at end of file
</table>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册