From 413607987e74998f1f20a2d0bad4897334b20bb8 Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Mon, 5 Dec 2011 14:53:18 -0800 Subject: [PATCH] Fix call indexing of attribute assignment call chains --- lib/brakeman/processors/lib/find_all_calls.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/brakeman/processors/lib/find_all_calls.rb b/lib/brakeman/processors/lib/find_all_calls.rb index 05b71146..e575cbab 100644 --- a/lib/brakeman/processors/lib/find_all_calls.rb +++ b/lib/brakeman/processors/lib/find_all_calls.rb @@ -96,7 +96,7 @@ class Brakeman::FindAllCalls < Brakeman::BaseProcessor #Returns method chain as an array #For example, User.human.alive.all would return [:User, :human, :alive, :all] def get_chain call - if call? call + if sexp? call and (call.node_type == :call or call.node_type == :attrasgn) get_chain(call[1]) + [call[2]] else [get_target(call)] -- GitLab