robotcoral/coral-app

View on GitHub

Showing 5 of 111 total issues

Function export has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

static export(world: World, robot: Robot, data: AdditionalWorldData) {
const worldData: WorldData = {
dimensions: world.getWorldSize(),
starting_position: robot.getCurrentCoordinates(),
starting_rotation: robot.getCardinal(),
Severity: Minor
Found in src/app/gameboard/utils/world.import.export.ts - About 2 hrs to fix

Function export has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

static export(world: World, robot: Robot, data: AdditionalWorldData) {
const worldData: WorldData = {
dimensions: world.getWorldSize(),
starting_position: robot.getCurrentCoordinates(),
starting_rotation: robot.getCardinal(),
Severity: Minor
Found in src/app/gameboard/utils/world.import.export.ts - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

    for (let z = 0; z < (world.objects[x][y] as Slab[]).length; z++)
    worldData.objects.push({
    position: { x, y, z },
    type: WORLDOBJECTTYPES.SLAB,
    data: {
    Severity: Major
    Found in src/app/gameboard/utils/world.import.export.ts - About 45 mins to fix

      Function repairInvalidSettings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      repairInvalidSettings() {
      if (
      !Object.values(THEMES || 'auto').includes(
      this.settings.globalSettings.theme
      )
      Severity: Minor
      Found in src/app/common/settings.service.ts - About 25 mins to fix

      Function pickUp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      pickUp(mode: WORLDOBJECTTYPES = WORLDOBJECTTYPES.SLAB) {
      try {
      const coo = this.model.robot.getMoveCoordinates();
      if (mode == WORLDOBJECTTYPES.SLAB) {
      this.model.world.pickUpSlab(coo);
      Severity: Minor
      Found in src/app/gameboard/utils/gameboard.controller.ts - About 25 mins to fix
      Severity
      Category
      Status
      Source
      Language