lib/brakeman/processors/alias_processor.rb
def only_ivars include_request_vars = false, lenv = nil
    lenv ||= env
    res = SexpProcessor::Environment.new

    if include_request_vars
      lenv.all.each do |k, v|
        #TODO Why would this have nil values?
        if (k.node_type == :ivar or request_value? k) and not v.nil?
          res[k] = v.dup
        end
      end
    else
      lenv.all.each do |k, v|
        #TODO Why would this have nil values?
        if k.node_type == :ivar and not v.nil?
          res[k] = v.dup
        end
      end
    end

    res
  end
#Returns a new SexpProcessor::Environment containing only instance variables.
#This is useful, for example, when processing views.
Returns a new SexpProcessor::Environment containing only instance variables.
This is useful, for example, when processing views.
Returns a new SexpProcessor :: Environment containing only instance variables . This is useful for example when processing views .
def only_ivars include_request_vars = false, lenv = nil
    lenv ||= env
    res = SexpProcessor::Environment.new
    if include_request_vars
      lenv.all.each do |k, v|
        if (k.node_type == :ivar or request_value? k) and not v.nil?
          res[k] = v.dup
        end
      end
    else
      lenv.all.each do |k, v|
        if k.node_type == :ivar and not v.nil?
          res[k] = v.dup
        end
      end
    end
    res
  end
def only_ivars include_request_vars = false , lenv = nil lenv ||= env res = SexpProcessor :: Environment . new if include_request_vars lenv . all . each do | k , v | if ( k . node_type == :ivar or request_value? k ) and not v . nil? res [ k ] = v . dup end end else lenv . all . each do | k , v | if k . node_type == :ivar and not v . nil? res [ k ] = v . dup end end end res end
Returns a new SexpProcessor::Environment containing only instance variables.
Returns a new SexpProcessor :: Environment containing only instance variables .
#TODO Why would this have nil values? #TODO Why would this have nil values?
include_request_vars
lenv