neo4jrb/neo4j-core

View on GitHub

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
Severity: Minor
Found in lib/neo4j/core/cypher_session/adaptors/http.rb - About 35 mins to fix

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 7 (exceeds 5 allowed). Consider refactoring.
Open

          def wrap_value(value)
            if value.is_a? Array
              value.map(&method(:wrap_value))
            elsif value.is_a? Hash
              value.map { |key, val| [key, wrap_value(val)] }.to_h
Severity: Minor
Found in lib/neo4j/core/cypher_session/responses/driver.rb - About 35 mins to fix

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)

Severity: Minor
Found in lib/neo4j/core/cypher_session/responses/bolt.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/neo4j/core/query.rb - About 25 mins to fix

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)
Severity: Minor
Found in lib/neo4j/core/query.rb - About 25 mins to fix

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)
Severity: Minor
Found in lib/neo4j/core/cypher_session/adaptors.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/neo4j/core/cypher_session/responses/embedded.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/neo4j/core/query_clauses.rb - About 25 mins to fix

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] ||= {}
Severity: Minor
Found in lib/neo4j/core/cypher_session/transactions.rb - About 25 mins to fix

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)
Severity: Minor
Found in lib/neo4j/core/cypher_session/responses/http.rb - About 25 mins to fix

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

Severity
Category
Status
Source
Language