aimmo-game-worker/simulation/pathfinding.py
Showing 2 of 2 total issues
Function astar
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def astar(world_map, start_cell, end_cell): """ Returns a list of Cell as a path from the given start to the given end in the given world_map. The best path navigates the obstacles (but not other avatars, as they're assumed to be moving). For explanation of the A* pathfinding, see the medium post at the top.
- Read upRead up
- Create a ticketCreate a ticket
Function _get_adjacent_cells
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _get_adjacent_cells(current_node, world_map): adj = [] # we move only in 4 directions for direction in ALL_DIRECTIONS: # make sure the cell is within the grid
- Read upRead up
- Create a ticketCreate a ticket