Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
社会瑞弟呀
brakeman
提交
b2ff5d26
B
brakeman
项目概览
社会瑞弟呀
/
brakeman
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
brakeman
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b2ff5d26
编写于
4月 25, 2013
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use options for FindAllCalls#process_source
上级
4f0a4d74
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
11 deletion
+12
-11
lib/brakeman/checks/check_sql.rb
lib/brakeman/checks/check_sql.rb
+1
-1
lib/brakeman/processors/lib/find_all_calls.rb
lib/brakeman/processors/lib/find_all_calls.rb
+5
-4
lib/brakeman/tracker.rb
lib/brakeman/tracker.rb
+6
-6
未找到文件。
lib/brakeman/checks/check_sql.rb
浏览文件 @
b2ff5d26
...
...
@@ -166,7 +166,7 @@ class Brakeman::CheckSQL < Brakeman::BaseCheck
if
block
.
node_type
==
:block
find_calls
=
Brakeman
::
FindAllCalls
.
new
tracker
find_calls
.
process_source
block
,
model_name
,
scope_name
find_calls
.
process_source
block
,
:class
=>
model_name
,
:method
=>
scope_name
find_calls
.
calls
.
each
do
|
call
|
if
@sql_targets
.
include?
call
[
:method
]
...
...
lib/brakeman/processors/lib/find_all_calls.rb
浏览文件 @
b2ff5d26
...
...
@@ -13,10 +13,11 @@ class Brakeman::FindAllCalls < Brakeman::BaseProcessor
#Process the given source. Provide either class and method being searched
#or the template. These names are used when reporting results.
def
process_source
exp
,
klass
=
nil
,
method
=
nil
,
template
=
nil
@current_class
=
klass
@current_method
=
method
@current_template
=
template
def
process_source
exp
,
opts
@current_class
=
opts
[
:class
]
@current_method
=
opts
[
:method
]
@current_template
=
opts
[
:template
]
@current_file
=
opts
[
:file
]
process
exp
end
...
...
lib/brakeman/tracker.rb
浏览文件 @
b2ff5d26
...
...
@@ -86,7 +86,7 @@ class Brakeman::Tracker
method_name
=
"
#{
definition
[
1
]
}
.
#{
method_name
}
"
end
yield
definition
,
set_name
,
method_name
yield
definition
,
set_name
,
method_name
,
info
[
:file
]
end
end
...
...
@@ -155,12 +155,12 @@ class Brakeman::Tracker
def
index_call_sites
finder
=
Brakeman
::
FindAllCalls
.
new
self
self
.
each_method
do
|
definition
,
set_name
,
method_name
|
finder
.
process_source
definition
,
set_name
,
method_nam
e
self
.
each_method
do
|
definition
,
set_name
,
method_name
,
file
|
finder
.
process_source
definition
,
:class
=>
set_name
,
:method
=>
method_name
,
:file
=>
fil
e
end
self
.
each_template
do
|
name
,
template
|
finder
.
process_source
template
[
:src
],
nil
,
nil
,
template
finder
.
process_source
template
[
:src
],
:template
=>
template
,
:file
=>
template
[
:file
]
end
@call_index
=
Brakeman
::
CallIndex
.
new
finder
.
calls
...
...
@@ -208,7 +208,7 @@ class Brakeman::Tracker
method_name
=
"
#{
definition
[
1
]
}
.
#{
method_name
}
"
end
finder
.
process_source
definition
,
set_name
,
method_name
finder
.
process_source
definition
,
:class
=>
set_name
,
:method
=>
method_name
,
:file
=>
info
[
:file
]
end
end
...
...
@@ -217,7 +217,7 @@ class Brakeman::Tracker
if
locations
.
include?
:templates
self
.
each_template
do
|
name
,
template
|
finder
.
process_source
template
[
:src
],
nil
,
nil
,
template
finder
.
process_source
template
[
:src
],
:template
=>
template
,
:file
=>
template
[
:file
]
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录