Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
brakeman
提交
caa2a309
B
brakeman
项目概览
CoCo_Code_Op2
/
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,发现更多精彩内容 >>
提交
caa2a309
编写于
1月 06, 2014
作者:
J
Justin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #417 from presidentbeef/stop_raising_exceptions_in_class_name
Stop raising exception in ProcessorHelper#class_name
上级
046f5afb
7310982d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
14 addition
and
43 deletion
+14
-43
lib/brakeman/checks/base_check.rb
lib/brakeman/checks/base_check.rb
+1
-7
lib/brakeman/processors/controller_processor.rb
lib/brakeman/processors/controller_processor.rb
+1
-7
lib/brakeman/processors/lib/find_all_calls.rb
lib/brakeman/processors/lib/find_all_calls.rb
+1
-5
lib/brakeman/processors/lib/processor_helper.rb
lib/brakeman/processors/lib/processor_helper.rb
+3
-2
lib/brakeman/processors/lib/render_helper.rb
lib/brakeman/processors/lib/render_helper.rb
+4
-3
lib/brakeman/processors/library_processor.rb
lib/brakeman/processors/library_processor.rb
+1
-6
lib/brakeman/processors/model_processor.rb
lib/brakeman/processors/model_processor.rb
+1
-6
lib/brakeman/processors/template_alias_processor.rb
lib/brakeman/processors/template_alias_processor.rb
+2
-7
未找到文件。
lib/brakeman/checks/base_check.rb
浏览文件 @
caa2a309
...
...
@@ -432,13 +432,7 @@ class Brakeman::BaseCheck < Brakeman::SexpProcessor
if
exp
.
is_a?
Symbol
@models
.
include?
exp
elsif
sexp?
exp
klass
=
nil
begin
klass
=
class_name
exp
rescue
StandardError
end
klass
and
@models
.
include?
klass
@models
.
include?
class_name
(
exp
)
else
false
end
...
...
lib/brakeman/processors/controller_processor.rb
浏览文件 @
caa2a309
...
...
@@ -23,13 +23,7 @@ class Brakeman::ControllerProcessor < Brakeman::BaseProcessor
#s(:class, NAME, PARENT, s(:scope ...))
def
process_class
exp
name
=
class_name
(
exp
.
class_name
)
begin
parent
=
class_name
exp
.
parent_name
rescue
StandardError
=>
e
Brakeman
.
debug
e
parent
=
nil
end
parent
=
class_name
(
exp
.
parent_name
)
#If inside a real controller, treat any other classes as libraries.
#But if not inside a controller already, then the class may include
...
...
lib/brakeman/processors/lib/find_all_calls.rb
浏览文件 @
caa2a309
...
...
@@ -122,11 +122,7 @@ class Brakeman::FindAllCalls < Brakeman::BaseProcessor
when
:true
,
:false
exp
[
0
]
when
:colon2
begin
class_name
exp
rescue
StandardError
exp
end
class_name
exp
when
:self
@current_class
||
@current_module
||
nil
else
...
...
lib/brakeman/processors/lib/processor_helper.rb
浏览文件 @
caa2a309
...
...
@@ -52,6 +52,7 @@ module Brakeman::ProcessorHelper
end
#Returns a class name as a Symbol.
#If class name cannot be determined, returns _exp_.
def
class_name
exp
case
exp
when
Sexp
...
...
@@ -69,14 +70,14 @@ module Brakeman::ProcessorHelper
when
:self
@current_class
||
@current_module
||
nil
else
raise
"Error: Cannot get class name from
#{
exp
}
"
exp
end
when
Symbol
exp
when
nil
nil
else
raise
"Error: Cannot get class name from
#{
exp
}
"
exp
end
end
end
lib/brakeman/processors/lib/render_helper.rb
浏览文件 @
caa2a309
...
...
@@ -161,9 +161,10 @@ module Brakeman::RenderHelper
if
call?
sexp
get_class_target
sexp
.
target
else
begin
class_name
sexp
rescue
klass
=
class_name
sexp
if
klass
.
is_a?
Symbol
klass
else
nil
end
end
...
...
lib/brakeman/processors/library_processor.rb
浏览文件 @
caa2a309
...
...
@@ -30,12 +30,7 @@ class Brakeman::LibraryProcessor < Brakeman::BaseProcessor
if
@tracker
.
libs
[
name
]
@current_class
=
@tracker
.
libs
[
name
]
else
begin
parent
=
class_name
exp
.
parent_name
rescue
StandardError
=>
e
Brakeman
.
debug
e
parent
=
nil
end
parent
=
class_name
exp
.
parent_name
@current_class
=
{
:name
=>
name
,
:parent
=>
parent
,
...
...
lib/brakeman/processors/model_processor.rb
浏览文件 @
caa2a309
...
...
@@ -27,12 +27,7 @@ class Brakeman::ModelProcessor < Brakeman::BaseProcessor
Brakeman
.
debug
"[Notice] Skipping inner class:
#{
name
}
"
ignore
else
begin
parent
=
class_name
exp
.
parent_name
rescue
StandardError
=>
e
Brakeman
.
debug
e
parent
=
nil
end
parent
=
class_name
exp
.
parent_name
@model
=
{
:name
=>
name
,
:parent
=>
parent
,
...
...
lib/brakeman/processors/template_alias_processor.rb
浏览文件 @
caa2a309
...
...
@@ -85,13 +85,8 @@ class Brakeman::TemplateAliasProcessor < Brakeman::AliasProcessor
if
exp
.
method
==
:all
or
exp
.
method
.
to_s
[
0
,
4
]
==
"find"
models
=
Set
.
new
@tracker
.
models
.
keys
begin
name
=
class_name
target
return
target
if
models
.
include?
(
name
)
rescue
StandardError
end
name
=
class_name
target
return
target
if
models
.
include?
(
name
)
end
return
get_model_target
(
target
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录