Showing 49 of 49 total issues
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
def add_node_to_index(index, key, value, id, unique = false)
options = {
:body => (
{ :uri => @connection.configuration + "/node/#{get_id(id)}",
:key => key,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 40.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method evaluate_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def evaluate_response(response, path, query_body, streaming, batching, stream = nil)
Similar blocks of code found in 2 locations. Consider refactoring. Open
def add_relationship_to_index(index, key, value, id, unique = false)
options = {
:body => (
{ :uri => @connection.configuration + "/relationship/#{get_id(id)}",
:key => key,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 40.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method return_result
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def return_result(response, code, body, parsed, path, query_body)
Method raise_errors
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def raise_errors(code, exception, message, stacktrace, request, index)
Similar blocks of code found in 2 locations. Consider refactoring. Open
Zip::File.open('neo4j.zip') do |zip_file|
zip_file.each do |f|
f_path=File.join(".", f.name)
FileUtils.mkdir_p(File.dirname(f_path))
begin
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 38.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
Zip::File.open('neo4j-spatial.zip') do |zip_file|
zip_file.each do |f|
f_path=File.join("neo4j/plugins/", f.name)
FileUtils.mkdir_p(File.dirname(f_path))
begin
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 38.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(message = nil, code = nil, stacktrace = nil, request = nil, index = 0)
Method create_unique
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.create_unique(index, key, value, props = nil, db = Neography::Rest.new)
Method handle_4xx_500_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_4xx_500_response(response, code, body, path, query_body)
Method add_node_to_index
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_node_to_index(index, key, value, id, unique = false)
Method remove_from_index_path
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def remove_from_index_path(klass, index, key_or_id, value_or_id = nil, id = nil)
Method batch_add_node_to_index
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def batch_add_node_to_index(index, key, value, id, unique = false)
Method batch_find_geometries_in_bbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def batch_find_geometries_in_bbox(layer, minx, maxx, miny, maxy)
Method add_relationship_to_index
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_relationship_to_index(index, key, value, id, unique = false)
Method get_path
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_path(from, to, relationships, depth = 1, algorithm = "shortestPath")
Method find_geometries_in_bbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_geometries_in_bbox(layer, minx, maxx, miny, maxy)
Method path_options
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def path_options(to, relationships, depth, algorithm, extra_body = {})
Method get_paths
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_paths(from, to, relationships, depth = 1, algorithm = "allPaths")