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)
File batch.rb
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Neography
class Rest
module Batch
include Neography::Rest::Helpers
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 = []
- 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 iterator
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def iterator
options = {
"order" => @order,
"uniqueness" => @uniqueness,
"relationships" => @relationships
- 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 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)
- 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 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")
- 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 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|
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 = []
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.",
- 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 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 = []
- 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 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]
Method iterator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def iterator
options = {
"order" => @order,
"uniqueness" => @uniqueness,
"relationships" => @relationships
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?
- 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 create_unique
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_unique(index, key, value, type, from_node, to_node, props = nil)
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)
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)
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")
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(from, to, algorithm, all=false, types = nil, dir = "all" )
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
- 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 evaluate_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def evaluate_response(response, path, query_body, streaming, batching, stream = nil)