Showing 63 of 340 total issues
File query_clauses.rb
has 584 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveGraph
module Core
module QueryClauses
class ArgError < StandardError
attr_reader :arg_part
- Create a ticketCreate a ticket
Class QueryProxy
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class QueryProxy
# rubocop:enable Metrics/ClassLength
include ActiveGraph::Node::Query::QueryProxyEnumerable
include ActiveGraph::Node::Query::QueryProxyMethods
include ActiveGraph::Node::Query::QueryProxyMethodsOfMassUpdating
- Create a ticketCreate a ticket
File has_n.rb
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveGraph::Node
module HasN
extend ActiveSupport::Concern
class NonPersistedNodeError < ActiveGraph::Error; end
- Create a ticketCreate a ticket
Class Association
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Association
include ActiveGraph::Shared::RelTypeConverters
include ActiveGraph::Node::Dependent::AssociationMethods
include ActiveGraph::Node::HasN::AssociationCypherMethods
- Create a ticketCreate a ticket
File type_converters.rb
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'bigdecimal'
require 'bigdecimal/util'
require 'active_support/core_ext/big_decimal/conversions'
require 'active_support/core_ext/string/conversions'
- Create a ticketCreate a ticket
Class Query
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Query
include ActiveGraph::Core::QueryClauses
include ActiveGraph::Core::QueryFindInBatches
DEFINED_CLAUSES = {}
- Create a ticketCreate a ticket
Class Runner
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Runner
STATUS_TABLE_FORMAT = '%-10s %-20s %s'.freeze
SEPARATOR = '--------------------------------------------------'.freeze
FILE_MISSING = '**** file missing ****'.freeze
STATUS_TABLE_HEADER = ['Status'.freeze, 'Migration ID'.freeze, 'Migration Name'.freeze].freeze
- Create a ticketCreate a ticket
Class DeclaredProperties
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class DeclaredProperties
include ActiveGraph::Shared::TypeConverters
attr_reader :klass
delegate :each, :each_pair, :each_key, :each_value, to: :registered_properties
- Create a ticketCreate a ticket
Class AssociationProxy
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class AssociationProxy
def initialize(query_proxy, deferred_objects = [], result_cache_proc = nil)
@query_proxy = query_proxy
@deferred_objects = deferred_objects
- Create a ticketCreate a ticket
Class Clause
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Clause
UNDERSCORE = '_'
COMMA_SPACE = ', '
AND = ' AND '
PRETTY_NEW_LINE = "\n "
- Create a ticketCreate a ticket
Method subscribe_to_query
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def subscribe_to_query
ActiveSupport::Notifications.subscribe('neo4j.core.cypher_query') do |_, _start, _finish, _id, payload|
query = payload[:query]
params_string = (query.parameters && !query.parameters.empty? ? "| #{query.parameters.inspect}" : EMPTY)
cypher = query.pretty_cypher ? (NEWLINE_W_SPACES if query.pretty_cypher.include?("\n")).to_s + query.pretty_cypher.gsub(/\n/, NEWLINE_W_SPACES) : query.cypher
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File query.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_graph/core/query_clauses'
require 'active_graph/core/query_find_in_batches'
require 'active_support/notifications'
module ActiveGraph
- Create a ticketCreate a ticket
Method process_unpersisted_nodes!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def process_unpersisted_nodes!
deferred_create_cache.dup.each do |association_name, nodes|
association_proxy = association_proxy(association_name)
nodes.each do |node|
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method generate_partitioning!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate_partitioning!
@partitioning = [[]]
@clauses.each do |clause|
if clause.nil? && !fresh_partition?
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method match_to
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def match_to(node)
first_node = node.is_a?(Array) ? node.first : node
where_arg = if first_node.respond_to?(:neo_id)
{neo_id: node.is_a?(Array) ? node.map(&:neo_id) : node}
elsif !node.nil?
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_attributes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def process_attributes(attributes = nil)
return attributes if attributes.blank?
multi_parameter_attributes = {}
new_attributes = {}
attributes.each_pair do |key, value|
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method association_proxy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def association_proxy(name, options = {})
name = name.to_sym
hash = association_proxy_hash(name, options)
association_proxy_cache_fetch(hash) do
if result_cache = self.instance_variable_get('@source_proxy_result_cache')
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method attribute!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def attribute!(name)
remove_instance_variable('@attribute_methods_generated') if instance_variable_defined?('@attribute_methods_generated')
define_attribute_methods([name]) unless attribute_names.include?(name)
attributes[name.to_s] = declared_properties[name]
define_method("#{name}=") do |value|
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def value
return @value if @value
[String, Symbol, Integer, Hash, NilClass].each do |arg_class|
from_method = "from_#{arg_class.name.downcase}"
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method wrapper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def wrapper(rel)
rel.properties.symbolize_keys!
begin
most_concrete_class = class_from_type(rel.type).constantize
return rel unless most_concrete_class < ActiveGraph::Relationship
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"