Class Brakeman::FindCall
In: lib/brakeman/processors/lib/find_call.rb
Parent: Brakeman::BasicProcessor

Finds method calls matching the given target(s).

   #-- This should be deprecated --#
   #--  Do not use for new code  --#

Targets/methods can be:

 - nil: matches anything, including nothing
 - Empty array: matches nothing
 - Symbol: matches single target/method exactly
 - Array of symbols: matches against any of the symbols
 - Regular expression: matches the expression
 - Array of regular expressions: matches any of the expressions

If a target is also the name of a class, methods called on instances of that class will also be matched, in a very limited way. (Any methods called on Klass.new, basically. More useful when used in conjunction with AliasProcessor.)

Examples:

 #To find any uses of this class:
 FindCall.new :FindCall, nil

 #Find system calls without a target
 FindCall.new [], [:system, :exec, :syscall]

 #Find all calls to length(), no matter the target
 FindCall.new nil, :length

 #Find all calls to sub, sub!, gsub, or gsub!
 FindCall.new nil, /^g?sub!?$/

Methods

Public Class methods

Public Instance methods

Returns a list of results.

A result looks like:

 s(:result, :ClassName, :method_name, s(:call, ...))

or

 s(:result, :template_name, s(:call, ...))

Process an assignment like a call

Look for matching calls and add them to results

Process body of method

process_defs(exp)

Alias for process_defn

Process body of block

Process the given source. Provide either class and method being searched or the template. These names are used when reporting results.

Use FindCall#matches to retrieve results.

[Validate]