Class Brakeman::Tracker
In: lib/brakeman/tracker.rb
Parent: Object

The Tracker keeps track of all the processed information.

Methods

Constants

UNKNOWN_MODEL = :BrakemanUnresolvedModel   Place holder when there should be a model, but it is not clear what model it will be.

Attributes

checks  [RW] 
config  [RW] 
constants  [RW] 
controllers  [RW] 
duration  [RW] 
end_time  [RW] 
errors  [RW] 
filter_cache  [RW] 
ignored_filter  [RW] 
initializers  [RW] 
libs  [RW] 
models  [RW] 
options  [RW] 
processor  [RW] 
routes  [RW] 
start_time  [RW] 
template_cache  [RW] 
templates  [RW] 

Public Class methods

Creates a new Tracker.

The Processor argument is only used by other Processors that might need to access it.

Public Instance methods

Searches the initializers for a method call

Iterate over all methods in controllers and models.

Iterates over each template, yielding the name and the template. Prioritizes templates which have been rendered.

Add an error to the list. If no backtrace is given, the one from the exception will be used.

Find a method call.

Options:

  * :target => target name(s)
  * :method => method name(s)
  * :chained => search in method chains

If :target => false or :target => nil, searches for methods without a target. Targets and methods can be specified as a symbol, an array of symbols, or a regular expression.

If :chained => true, matches target at head of method chain and method at end.

For example:

    find_call :target => User, :method => :all, :chained => true

could match

    User.human.active.all(...)

Reindex call sites

Takes a set of symbols which can include :templates, :models, or :controllers

This will limit reindexing to the given sets

Returns a Report with this Tracker‘s information

Clear information related to model

Clear information related to model

Clear information about routes

Clear information related to template

Clear information related to templates. If :only_rendered => true, will delete templates rendered from controllers (but not those rendered from other templates)

Run a set of checks on the current information. Results will be stored in Tracker#checks.

[Validate]