Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
Brakeman
提交
2b5e521f
B
Brakeman
项目概览
李少辉-开发者
/
Brakeman
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Brakeman
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2b5e521f
编写于
1月 22, 2014
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove `rescue Exception` instances
closes #428
上级
b3b15be7
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
17 addition
and
17 deletion
+17
-17
lib/brakeman/checks.rb
lib/brakeman/checks.rb
+2
-2
lib/brakeman/processors/alias_processor.rb
lib/brakeman/processors/alias_processor.rb
+1
-1
lib/brakeman/processors/erb_template_processor.rb
lib/brakeman/processors/erb_template_processor.rb
+1
-1
lib/brakeman/processors/haml_template_processor.rb
lib/brakeman/processors/haml_template_processor.rb
+2
-2
lib/brakeman/processors/output_processor.rb
lib/brakeman/processors/output_processor.rb
+1
-1
lib/brakeman/processors/template_processor.rb
lib/brakeman/processors/template_processor.rb
+1
-1
lib/brakeman/scanner.rb
lib/brakeman/scanner.rb
+8
-8
lib/ruby_parser/bm_sexp_processor.rb
lib/ruby_parser/bm_sexp_processor.rb
+1
-1
未找到文件。
lib/brakeman/checks.rb
浏览文件 @
2b5e521f
...
...
@@ -100,7 +100,7 @@ class Brakeman::Checks
begin
check
.
run_check
rescue
Exception
=>
e
rescue
=>
e
tracker
.
error
e
end
...
...
@@ -138,7 +138,7 @@ class Brakeman::Checks
begin
check
.
run_check
rescue
Exception
=>
e
rescue
=>
e
error_mutex
.
synchronize
do
tracker
.
error
e
end
...
...
lib/brakeman/processors/alias_processor.rb
浏览文件 @
2b5e521f
...
...
@@ -58,7 +58,7 @@ class Brakeman::AliasProcessor < Brakeman::SexpProcessor
e
end
end
rescue
Exception
=>
err
rescue
=>
err
@tracker
.
error
err
if
@tracker
end
...
...
lib/brakeman/processors/erb_template_processor.rb
浏览文件 @
2b5e521f
...
...
@@ -20,7 +20,7 @@ class Brakeman::ErbTemplateProcessor < Brakeman::TemplateProcessor
@inside_concat
=
false
if
exp
.
second_arg
raise
Exception
.
new
(
"Did not expect more than a single argument to _erbout.concat"
)
raise
"Did not expect more than a single argument to _erbout.concat"
end
arg
=
exp
.
first_arg
...
...
lib/brakeman/processors/haml_template_processor.rb
浏览文件 @
2b5e521f
...
...
@@ -30,7 +30,7 @@ class Brakeman::HamlTemplateProcessor < Brakeman::TemplateProcessor
out
=
exp
.
first_arg
=
process
(
arg
)
@inside_concat
=
false
else
raise
Exception
.
new
(
"Empty _hamlout.
#{
method
}
()?"
)
raise
"Empty _hamlout.
#{
method
}
()?"
end
if
string?
out
...
...
@@ -46,7 +46,7 @@ class Brakeman::HamlTemplateProcessor < Brakeman::TemplateProcessor
Sexp
.
new
:format
,
out
end
else
raise
Exception
.
new
(
"Unrecognized action on _hamlout:
#{
method
}
"
)
raise
"Unrecognized action on _hamlout:
#{
method
}
"
end
end
...
...
lib/brakeman/processors/output_processor.rb
浏览文件 @
2b5e521f
...
...
@@ -18,7 +18,7 @@ class Brakeman::OutputProcessor < Ruby2Ruby
def
process
exp
begin
super
exp
if
sexp?
exp
and
not
exp
.
empty?
rescue
Exception
=>
e
rescue
=>
e
Brakeman
.
debug
"While formatting
#{
exp
}
:
#{
e
}
\n
#{
e
.
backtrace
.
join
(
"
\n
"
)
}
"
end
end
...
...
lib/brakeman/processors/template_processor.rb
浏览文件 @
2b5e521f
...
...
@@ -26,7 +26,7 @@ class Brakeman::TemplateProcessor < Brakeman::BaseProcessor
def
process
exp
begin
super
rescue
Exception
=>
e
rescue
=>
e
except
=
e
.
exception
(
"Error when processing
#{
@current_template
[
:name
]
}
:
#{
e
.
message
}
"
)
except
.
set_backtrace
(
e
.
backtrace
)
raise
except
...
...
lib/brakeman/scanner.rb
浏览文件 @
2b5e521f
...
...
@@ -95,7 +95,7 @@ class Brakeman::Scanner
@processor
.
process_config
(
parse_ruby
(
@app_tree
.
read
(
path
)))
end
rescue
Exception
=>
e
rescue
=>
e
Brakeman
.
notify
"[Notice] Error while processing
#{
path
}
"
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
while processing
#{
path
}
"
),
e
.
backtrace
end
...
...
@@ -111,7 +111,7 @@ class Brakeman::Scanner
@processor
.
process_gems
(
parse_ruby
(
@app_tree
.
read
(
"Gemfile"
)))
end
end
rescue
Exception
=>
e
rescue
=>
e
Brakeman
.
notify
"[Notice] Error while processing Gemfile."
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing Gemfile"
),
e
.
backtrace
end
...
...
@@ -131,7 +131,7 @@ class Brakeman::Scanner
@processor
.
process_initializer
(
path
,
parse_ruby
(
@app_tree
.
read_path
(
path
)))
rescue
Racc
::
ParseError
=>
e
tracker
.
error
e
,
"could not parse
#{
path
}
. There is probably a typo in the file. Test it with 'ruby_parse
#{
path
}
'"
rescue
Exception
=>
e
rescue
=>
e
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing
#{
path
}
"
),
e
.
backtrace
end
end
...
...
@@ -162,7 +162,7 @@ class Brakeman::Scanner
@processor
.
process_lib
parse_ruby
(
@app_tree
.
read_path
(
path
)),
path
rescue
Racc
::
ParseError
=>
e
tracker
.
error
e
,
"could not parse
#{
path
}
. There is probably a typo in the file. Test it with 'ruby_parse
#{
path
}
'"
rescue
Exception
=>
e
rescue
=>
e
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing
#{
path
}
"
),
e
.
backtrace
end
end
...
...
@@ -174,7 +174,7 @@ class Brakeman::Scanner
if
@app_tree
.
exists?
(
"config/routes.rb"
)
begin
@processor
.
process_routes
parse_ruby
(
@app_tree
.
read
(
"config/routes.rb"
))
rescue
Exception
=>
e
rescue
=>
e
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing routes.rb"
),
e
.
backtrace
Brakeman
.
notify
"[Notice] Error while processing routes - assuming all public controller methods are actions."
options
[
:assume_all_routes
]
=
true
...
...
@@ -219,7 +219,7 @@ class Brakeman::Scanner
@processor
.
process_controller
(
parse_ruby
(
@app_tree
.
read_path
(
path
)),
path
)
rescue
Racc
::
ParseError
=>
e
tracker
.
error
e
,
"could not parse
#{
path
}
. There is probably a typo in the file. Test it with 'ruby_parse
#{
path
}
'"
rescue
Exception
=>
e
rescue
=>
e
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing
#{
path
}
"
),
e
.
backtrace
end
end
...
...
@@ -305,7 +305,7 @@ class Brakeman::Scanner
tracker
.
error
e
,
"could not parse
#{
path
}
"
rescue
Haml
::
Error
=>
e
tracker
.
error
e
,
[
"While compiling HAML in
#{
path
}
"
]
<<
e
.
backtrace
rescue
Exception
=>
e
rescue
StandardError
,
LoadError
=>
e
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing
#{
path
}
"
),
e
.
backtrace
end
end
...
...
@@ -339,7 +339,7 @@ class Brakeman::Scanner
@processor
.
process_model
(
parse_ruby
(
@app_tree
.
read_path
(
path
)),
path
)
rescue
Racc
::
ParseError
=>
e
tracker
.
error
e
,
"could not parse
#{
path
}
"
rescue
Exception
=>
e
rescue
=>
e
tracker
.
error
e
.
exception
(
e
.
message
+
"
\n
While processing
#{
path
}
"
),
e
.
backtrace
end
end
...
...
lib/ruby_parser/bm_sexp_processor.rb
浏览文件 @
2b5e521f
...
...
@@ -88,7 +88,7 @@ class Brakeman::SexpProcessor
def
error_handler
(
type
,
exp
=
nil
)
# :nodoc:
begin
return
yield
rescue
StandardError
=>
err
rescue
=>
err
warn
"
#{
err
.
class
}
Exception thrown while processing
#{
type
}
for sexp
#{
exp
.
inspect
}
#{
caller
.
inspect
}
"
if
$DEBUG
raise
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录