提交 3d215127 编写于 作者: J Justin Collins

Also ignore warnings in tabs output

上级 66db18b1
......@@ -2,10 +2,10 @@
#https://github.com/presidentbeef/brakeman-jenkins-plugin
class Brakeman::Report::Tabs < Brakeman::Report::Base
def generate_report
[[:warnings, "General"], [:controller_warnings, "Controller"],
[[:generic_warnings, "General"], [:controller_warnings, "Controller"],
[:model_warnings, "Model"], [:template_warnings, "Template"]].map do |meth, category|
checks.send(meth).map do |w|
self.send(meth).map do |w|
line = w.line || 0
w.warning_type.gsub!(/[^\w\s]/, ' ')
"#{warning_file(w, :absolute)}\t#{line}\t#{w.warning_type}\t#{category}\t#{w.format_message}\t#{TEXT_CONFIDENCE[w.confidence]}"
......
class TestTabsOutput < Test::Unit::TestCase
Report = Brakeman.run(:app_path => "#{TEST_PATH}/apps/rails2", :quiet => true).report.to_tabs
def test_reported_warnings
if Brakeman::Scanner::RUBY_1_9
assert_equal Report.lines.to_a.count, 96
else
assert_equal Report.lines.to_a.count, 97
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册