Process an assignment like a call
# File lib/brakeman/processors/lib/find_all_calls.rb, line 101 def process_attrasgn exp process_call exp end
# File lib/brakeman/processors/lib/find_all_calls.rb, line 38 def process_call exp target = get_target exp.target if call? target already_in_target = @in_target @in_target = true process target @in_target = already_in_target end method = exp.method process_call_args exp call = { :target => target, :method => method, :call => exp, :nested => @in_target, :chain => get_chain(exp) } if @current_template call[:location] = [:template, @current_template] else call[:location] = [:class, @current_class, @current_method] end @calls << call exp end
Technically, " is call to Kernel#` But we just need them in the call cache for speed
# File lib/brakeman/processors/lib/find_all_calls.rb, line 84 def process_dxstr exp process exp.last if sexp? exp.last call = { :target => nil, :method => :`, :call => exp, :nested => false } if @current_template call[:location] = [:template, @current_template] else call[:location] = [:class, @current_class, @current_method] end @calls << call exp end
Process body of method
# File lib/brakeman/processors/lib/find_all_calls.rb, line 24 def process_methdef exp process_all exp.body end
Calls to render() are converted to s(:render, ...) but we would like them in the call cache still for speed
# File lib/brakeman/processors/lib/find_all_calls.rb, line 66 def process_render exp process exp.last if sexp? exp.last call = { :target => nil, :method => :render, :call => exp, :nested => false } if @current_template call[:location] = [:template, @current_template] else call[:location] = [:class, @current_class, @current_method] end @calls << call exp end
Process body of block
# File lib/brakeman/processors/lib/find_all_calls.rb, line 34 def process_rlist exp process_all exp end
Process body of method
# File lib/brakeman/processors/lib/find_all_calls.rb, line 29 def process_selfdef exp process_all exp.body end
Process the given source. Provide either class and method being searched or the template. These names are used when reporting results.
# File lib/brakeman/processors/lib/find_all_calls.rb, line 16 def process_source exp, klass = nil, method = nil, template = nil @current_class = klass @current_method = method @current_template = template process exp end
Generated with the Darkfish Rdoc Generator 2.