Function export
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
static export(world: World, robot: Robot, data: AdditionalWorldData) {
const worldData: WorldData = {
dimensions: world.getWorldSize(),
starting_position: robot.getCurrentCoordinates(),
starting_rotation: robot.getCardinal(),
Function export
has 44 lines of code (exceeds 25 allowed). Consider refactoring.
static export(world: World, robot: Robot, data: AdditionalWorldData) {
const worldData: WorldData = {
dimensions: world.getWorldSize(),
starting_position: robot.getCurrentCoordinates(),
starting_rotation: robot.getCardinal(),
Avoid deeply nested control flow statements.
for (let z = 0; z < (world.objects[x][y] as Slab[]).length; z++)
worldData.objects.push({
position: { x, y, z },
type: WORLDOBJECTTYPES.SLAB,
data: {
Function repairInvalidSettings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
repairInvalidSettings() {
if (
!Object.values(THEMES || 'auto').includes(
this.settings.globalSettings.theme
)
Function pickUp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
pickUp(mode: WORLDOBJECTTYPES = WORLDOBJECTTYPES.SLAB) {
try {
const coo = this.model.robot.getMoveCoordinates();
if (mode == WORLDOBJECTTYPES.SLAB) {
this.model.world.pickUpSlab(coo);