Showing 8 of 15 total issues
Method retrieve_points
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_points(active_list, points, num_of_points, radius)
return if active_list.empty?
current_point, active_index = retreive_current_point(active_list)
found = false
- 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 neighbours_empty?
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def neighbours_empty?(new_point, radius)
cell_empty = true
(-radius..radius).each do |dy|
(-radius..radius).each do |dx|
x = new_point.x + dx
- 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 neighbors
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def neighbors(node)
neighbors = []
return neighbors unless node.can_haz_road?
x = node.x
- 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 find_path
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def find_path(start_node, end_node, grid)
came_from = {}
g_score = { start_node => 0 }
f_score = { start_node => manhattan_distance(start_node, end_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 generate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate(config)
return unless config.generate_flora
puts 'generating flora...' if config.verbose
tiles.each do |row|
- 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 find_minimum_edge
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_minimum_edge(distances, visited)
# method to find the minimum edge connecting visited and unvisited nodes
min_edge = nil
min_distance = Float::INFINITY
- 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 generate_town
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_town(town_num, num_of_points, radius, initial_coords, verbose)
Method heapify_down
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def heapify_down(index)
left_child_index = 2 * index + 1
right_child_index = 2 * index + 2
smallest = index
- 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"