maxdemarzi/neography

View on GitHub

Showing 35 of 49 total issues

Class Rest has 53 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Rest
    module Batch
      include Neography::Rest::Helpers
    
      def batch(*args)
Severity: Major
Found in lib/neography/rest/batch.rb - About 7 hrs to fix

    File batch.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Neography
      class Rest
        module Batch
          include Neography::Rest::Helpers
        
    Severity: Minor
    Found in lib/neography/rest/batch.rb - About 3 hrs to fix

      Method find has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

            def find(*args)
              db = args[3] ? args.pop : Neography::Rest.new
      
              if self <= Neography::Node
                nodes = []
      Severity: Minor
      Found in lib/neography/index.rb - About 2 hrs 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 iterator has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def iterator
            options = {
              "order"         => @order,
              "uniqueness"    => @uniqueness,
              "relationships" => @relationships
      Severity: Minor
      Found in lib/neography/node_traverser.rb - About 2 hrs 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 return_result has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def return_result(response, code, body, parsed, path, query_body)
            case code
            when 200
              @logger.debug "OK #{body}" if @log_enabled
              parsed ? body : @parser.json(body)
      Severity: Minor
      Found in lib/neography/connection.rb - About 1 hr 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 each has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def each
            iterator.each do |path|
              paths = Array.new
      
              if @get.include?("node")
      Severity: Minor
      Found in lib/neography/path_traverser.rb - About 1 hr 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 convert_cypher has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def convert_cypher(statements)
              array = []
              query = nil
              parameters = nil
              Array(statements).each do |statement|
      Severity: Minor
      Found in lib/neography/rest/transactions.rb - About 1 hr to fix

        Method create_nodes_threaded has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def create_nodes_threaded(nodes)
                nodes = Array.new(nodes) if nodes.kind_of? Fixnum
        
                node_queue = Queue.new
                thread_pool = []
        Severity: Minor
        Found in lib/neography/rest/nodes.rb - About 1 hr to fix

          Method handle_4xx_500_response has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def handle_4xx_500_response(response, code, body, path, query_body)
                index = 0
                request = {:path => path, :body => query_body}
                if body.nil? or body == ""
                  parsed_body = {"message" => "No error message returned from server.",
          Severity: Minor
          Found in lib/neography/connection.rb - About 1 hr 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 create_nodes_threaded has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

                def create_nodes_threaded(nodes)
                  nodes = Array.new(nodes) if nodes.kind_of? Fixnum
          
                  node_queue = Queue.new
                  thread_pool = []
          Severity: Minor
          Found in lib/neography/rest/nodes.rb - About 1 hr 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 save_local_configuration has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def save_local_configuration(config)
                @protocol           = config[:protocol]
                @server             = config[:server]
                @port               = config[:port]
                @directory          = config[:directory]
          Severity: Minor
          Found in lib/neography/connection.rb - About 1 hr to fix

            Method iterator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def iterator
                  options = {
                    "order"         => @order,
                    "uniqueness"    => @uniqueness,
                    "relationships" => @relationships
            Severity: Minor
            Found in lib/neography/node_traverser.rb - About 1 hr to fix

              Method []= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def []=(key, value)
                    key = key.to_sym
                    k_str = key.to_s
                    if value.nil?
                      unless @table[key].nil?
              Severity: Minor
              Found in lib/neography/property.rb - About 55 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 create_unique has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    def create_unique(index, key, value, type, from_node, to_node, props = nil)
              Severity: Major
              Found in lib/neography/relationship.rb - About 50 mins to fix

                Method batch_create_unique_relationship has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      def batch_create_unique_relationship(index, key, value, type, from, to, props = nil)
                Severity: Major
                Found in lib/neography/rest/batch.rb - About 50 mins to fix

                  Method create_unique_relationship has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        def create_unique_relationship(index, key, value, type, from, to, props = nil)
                  Severity: Major
                  Found in lib/neography/rest/relationship_indexes.rb - About 50 mins to fix

                    Method get_shortest_weighted_path has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def get_shortest_weighted_path(from, to, relationships, weight_attribute = "weight", depth = 1, algorithm = "dijkstra")
                    Severity: Minor
                    Found in lib/neography/rest/node_paths.rb - About 45 mins to fix

                      Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def initialize(from, to, algorithm, all=false, types = nil, dir = "all" )
                      Severity: Minor
                      Found in lib/neography/path_traverser.rb - About 45 mins to fix

                        Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def initialize(hash=nil)
                              @table = {}
                              unless hash.nil?
                                if hash["self"] # coming from REST API
                                  @neo_id = hash["self"].split('/').last
                        Severity: Minor
                        Found in lib/neography/property_container.rb - About 45 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 evaluate_response has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def evaluate_response(response, path, query_body, streaming, batching, stream = nil)
                        Severity: Minor
                        Found in lib/neography/connection.rb - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language