Showing 30 of 34 total issues
Method request_body
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def request_body(body)
return body if body.is_a?(String)
body_is_query_array = body.is_a?(Array) && body.all? { |o| o.respond_to?(:cypher) }
case body
- Read upRead up
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
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_nodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def match_nodes(hash, optional_match = false)
hash.inject(self) do |query, (variable, node_object)|
neo_id = (node_object.respond_to?(:neo_id) ? node_object.neo_id : node_object)
match_method = optional_match ? :optional_match : :match
- Read upRead up
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 extract_message_groups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_message_groups(flush_messages_proc)
fields_messages = flush_messages_proc.call
validate_message_type!(fields_messages[0], :success)
- Read upRead up
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 wrap_entity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wrap_entity(row_datum, rest_datum)
if rest_datum.is_a?(Array)
row_datum.zip(rest_datum).map { |row, rest| wrap_entity(row, rest) }
elsif ident = identify_entity(rest_datum)
send("wrap_#{ident}", rest_datum, row_datum)
- Read upRead up
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 wrap_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wrap_value(entity)
case entity
when Java::ScalaCollectionConvert::Wrappers::MapWrapper
entity.each_with_object({}) { |(k, v), r| r[k.to_sym] = _wrap_entity(v) }
when Java::OrgNeo4jKernelImplCore::NodeProxy, Java::OrgNeo4jKernelImplCore::RelationshipProxy
- Read upRead up
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 from_key_and_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_key_and_value(key, value)
case value
when String, Symbol
self.class.from_key_and_single_value(key, value)
when Array
- Read upRead up
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_cypher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_cypher(options = {})
join_string = options[:pretty] ? NEWLINE : EMPTY
cypher_string = partitioned_clauses.map do |clauses|
clauses_by_class = clauses.group_by(&:class)
- Read upRead up
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 query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def query(*args)
options = if args[0].is_a?(::Neo4j::Core::Query)
args[1] ||= {}
else
args[1] ||= {}
- Read upRead up
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 transaction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def transaction(session)
return self.class.transaction_class.new(session) if !block_given?
begin
tx = transaction(session)
- Read upRead up
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"