Showing 63 of 347 total issues
Method run_transaction_work
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run_transaction_work(session, method, **config, &block)
implicit = config.delete(:implicit)
session.send(method, **config) do |tx|
self.tx = tx
block.call(tx).tap do |result|
- 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 hash_key_value_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def hash_key_value_string(key, value, previous_keys)
value.map do |k, v|
if k.to_sym == :neo_id
v = Array(v).map { |item| (item.respond_to?(:neo_id) ? item.neo_id : item).to_i }
key_value_string("ID(#{key})", v)
- 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 key_value_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def key_value_string(key, value, previous_keys = [], is_set = false)
param = (previous_keys << key).join(UNDERSCORE)
self.class.paramaterize_key!(param)
if value.is_a?(Range)
- 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 constraint_or_index
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def constraint_or_index(name, options)
# either constraint or index, do not set both
if options[:constraint]
fail "unknown constraint type #{options[:constraint]}, only :unique supported" if options[:constraint] != :unique
constraint(name, type: :unique)
- 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 convert_properties_to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convert_properties_to(obj, medium, properties)
direction = medium == :ruby ? :to_ruby : :to_db
properties.to_h.each_pair do |key, value|
next if skip_conversion?(obj, 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 clause_strings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clause_strings(clauses)
clauses.flat_map do |clause|
Array(clause.value).map do |v|
(clause.options[:not] ? 'NOT' : '') + (v.to_s.match(PAREN_SURROUND_REGEX) ? v.to_s : "(#{v})")
end
- 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 target_class_option
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def target_class_option(model_class)
case model_class
when nil
@target_class_name_from_name ? "#{association_model_namespace}::#{@target_class_name_from_name}" : @target_class_name_from_name
when Array
- 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 unique_nodes_query
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def unique_nodes_query(association, self_identifer, other_node, other_rel, ids)
- Create a ticketCreate a ticket
Method unique_nodes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def unique_nodes(association, self_identifer, other_node, other_rel, ids = [])
- Create a ticketCreate a ticket
Method arrow_cypher
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def arrow_cypher(var = nil, properties = {}, create = false, reverse = false, length = nil)
- Create a ticketCreate a ticket
Method cypher_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cypher_string(dir = :outbound)
case dir
when :outbound
identifier = '(n1'
identifier + (_from_class == :any ? ')' : cypher_label(:outbound))
- 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 count
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def count(distinct = nil, target = nil)
return 0 if unpersisted_start_object?
fail(ActiveGraph::InvalidParameterError, ':count accepts the `:distinct` symbol or nil as a parameter') unless distinct.nil? || distinct == :distinct
query_with_target(target) do |var|
q = ensure_distinct(var, !distinct.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 derive_model_class
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def derive_model_class
refresh_model_class! if pending_model_refresh?
return @model_class unless @model_class.nil?
return nil if relationship_class.nil?
dir_class = direction == :in ? :from_class : :to_class
- 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 format_label
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def format_label(label_arg)
return label_arg.map { |arg| format_label(arg) }.join if label_arg.is_a?(Array)
label_arg = label_arg.to_s.strip
if !label_arg.empty? && label_arg[0] != ':'
- 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 set_instance_caches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_instance_caches(instance, node, rel)
instance.each do |object|
object.instance_variable_set('@source_query_proxy', self)
object.instance_variable_set('@source_proxy_result_cache', instance)
if node && rel && object.last.is_a?(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"
Further reading
Method validate_model_schema!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_model_schema!
ensure_model_data_state!
messages = {index: [], constraint: []}
each_schema_element do |type, model, label, property_name, exists|
if exists
- 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 to_other
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_other(direction, value, type)
fail "Unknown direction given: #{direction}" unless direction == :to_ruby || direction == :to_db
found_converter = converter_for(type)
return value unless found_converter
return value if direction == :to_db && formatted_for_db?(found_converter, 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 apply_default_values
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_default_values
return if self.class.declared_property_defaults.empty?
self.class.declared_property_defaults.each_pair do |key, value|
self.send("#{key}=", value.respond_to?(:call) ? value.call : value) if self.send(key).nil?
end
- 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 for_where_clause
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def for_where_clause(arg, model, *args)
node_num = 1
result = []
if arg.is_a?(Hash)
arg.each 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 include?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def include?(other, target = nil)
query_with_target(target) do |var|
where_filter = if other.respond_to?(:neo_id) || association_id_key == :neo_id
"ID(#{var}) = $other_node_id"
else
- 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"