提交 6a5f9cb0 编写于 作者: J Justin Collins

Continue processing class when error on parent

Don't bail out on processing a class if an error is raised when
determining the parent class name.
上级 64af32d9
......@@ -30,8 +30,16 @@ class Brakeman::ControllerProcessor < Brakeman::BaseProcessor
if @current_module
name = (@current_module.to_s + "::" + name.to_s).to_sym
end
begin
parent = class_name exp[2]
rescue StandardError => e
Brakeman.debug e
parent = nil
end
@controller = { :name => name,
:parent => class_name(exp[2]),
:parent => parent,
:includes => [],
:public => {},
:private => {},
......
......@@ -30,8 +30,15 @@ class Brakeman::LibraryProcessor < Brakeman::BaseProcessor
if @tracker.libs[name]
@current_class = @tracker.libs[name]
else
begin
parent = class_name exp[2]
rescue StandardError => e
Brakeman.debug e
parent = nil
end
@current_class = { :name => name,
:parent => class_name(exp[2]),
:parent => parent,
:includes => [],
:public => {},
:private => {},
......
......@@ -22,8 +22,15 @@ class Brakeman::ModelProcessor < Brakeman::BaseProcessor
Brakeman.debug "[Notice] Skipping inner class: #{class_name exp[1]}"
ignore
else
begin
parent = class_name exp[2]
rescue StandardError => e
Brakeman.debug e
parent = nil
end
@model = { :name => class_name(exp[1]),
:parent => class_name(exp[2]),
:parent => parent,
:includes => [],
:public => {},
:private => {},
......
class SomeModel < @some_variable
end
class Alib < $SOME_CONSTANT
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册