Class: MetzScan::Analyzers::RepeatedQueryCriteria::QuerySiteCollector::QuerySite

Inherits:
Struct
  • Object
show all
Defined in:
lib/metz_scan/analyzers/repeated_query_criteria.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#criteria_keysObject

Returns the value of attribute criteria_keys

Returns:

  • (Object)

    the current value of criteria_keys



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def criteria_keys
  @criteria_keys
end

#enclosing_nameObject

Returns the value of attribute enclosing_name

Returns:

  • (Object)

    the current value of enclosing_name



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def enclosing_name
  @enclosing_name
end

#expressionObject

Returns the value of attribute expression

Returns:

  • (Object)

    the current value of expression



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def expression
  @expression
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def line
  @line
end

#method_nameObject

Returns the value of attribute method_name

Returns:

  • (Object)

    the current value of method_name



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def method_name
  @method_name
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def path
  @path
end

#query_methodObject

Returns the value of attribute query_method

Returns:

  • (Object)

    the current value of query_method



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def query_method
  @query_method
end

#query_operationObject

Returns the value of attribute query_operation

Returns:

  • (Object)

    the current value of query_operation



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def query_operation
  @query_operation
end

#receiverObject

Returns the value of attribute receiver

Returns:

  • (Object)

    the current value of receiver



153
154
155
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 153

def receiver
  @receiver
end

Instance Method Details

#contextObject



167
168
169
170
171
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 167

def context
  return "#{enclosing_name}#{method_name}" if enclosing_name && method_name

  method_name || enclosing_name
end

#fingerprintObject



163
164
165
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 163

def fingerprint
  [receiver, query_method, criteria_keys].join(":")
end

#queryObject



155
156
157
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 155

def query
  "#{receiver}.#{query_method}(#{criteria_keys.join(', ')})"
end

#receiver_shapeObject



159
160
161
# File 'lib/metz_scan/analyzers/repeated_query_criteria.rb', line 159

def receiver_shape
  receiver.include?(".") ? "scope_chain" : "constant"
end