Showing 31 of 33 total issues
Method join_ways
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def join_ways(ways)
closed_ways = []
endpoints_to_ways = EndpointToWayMap.new
for way in ways
if way.closed?
Method split_way_with_nodes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def split_way_with_nodes(way)
nodes_used = []
nodes = []
# Get nodes really used and all nodes (used and for geometry need) for a way
way.nodes.each_with_index do |node_id, 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"
Further reading
Method path_weights
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def path_weights(path)
path_weights = 0
# Add path weight
path_weights += path_weight(path.length_in_meter) if path.respond_to?(:length_in_meter)
- 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 initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, lon, lat, addr_housenumber = "", ways = [], end_of_way = false, tags = {} )
Method ways
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ways(node, context={})
paths =
if GeoRuby::SimpleFeatures::Point === node
# Search access to physical roads for departure
ActiveRoad::AccessLink.from(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 physical_road_conditionnal_costs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def physical_road_conditionnal_costs(way)
[].tap do |prcc|
prcc << [ "car", Float::MAX] if !way.car
prcc << [ "pedestrian", Float::MAX] if !way.pedestrian
prcc << [ "bike", Float::MAX] if !way.bike
- 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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(departure, arrival, speed = 4, constraints = [], follow_way_filter = {})
Method join_way
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def join_way(way, other)
if way.closed?
raise StandardError, "Trying to join a closed way to another"
end
if other.closed?
- 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 conditionnal_costs_sum
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def conditionnal_costs_sum(conditionnal_costs)
conditionnal_costs_tags = conditionnal_costs.collect(&:tags)
if linked?(conditionnal_costs_tags)
if unauthorized_constraints && unauthorized_constraints_intersection_with?(conditionnal_costs_tags)
return Float::MAX
- 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 backup_nodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def backup_nodes
Rails.logger.info "Begin to backup nodes in LevelDB nodes_database in #{nodes_database_path}"
start = Time.now
nodes_parser = ::PbfParser.new(pbf_file)
nodes_counter = 0
- 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 square_sqls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.square_sqls( size)
result = []
step = (1.0 / size)
index_x = 0
0.upto( size) do |i_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"