ocadotechnology/aimmo

View on GitHub

Showing 155 of 178 total issues

File sdk_pb2.py has 718 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sdk.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
Severity: Major
Found in aimmo-game/agones/sdk_pb2.py - About 1 day to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('edits interactable from an Interactable with the same type', async () => {
const interactableItem = interactableDiffItem(1, 'score', { x: 0, y: 1 })
 
await interactableManager.add(interactableItem)
 
 
game_frontend/src/babylon/entities/interactableManager.test.ts on lines 98..114

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('edits interactable from an Interactable with a different type', async () => {
const interactableItem = interactableDiffItem(1, 'key', { x: 2, y: 3 })
 
await interactableManager.add(interactableItem)
 
 
game_frontend/src/babylon/entities/interactableManager.test.ts on lines 80..96

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('returns wait action and prints syntax warning on syntax error', () => {
const avatarCode = {
code: `def next_turn(world_state, avatar_state):
return MoveAction(direction.)`
}
game_frontend/cypress/integration/avatarWorker/codeExecution.spec.js on lines 51..71

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('returns wait action and prints indentation warning on indentation error', () => {
const avatarCode = {
code: `def next_turn(world_state, avatar_state):
return MoveAction(direction.NORTH)`
}
game_frontend/cypress/integration/avatarWorker/codeExecution.spec.js on lines 29..49

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('Student user', () => {
before(() => {
cy.login()
cy.addTestGame()
cy.logout()
Severity: Major
Found in game_frontend/cypress/integration/user/navigation.spec.js and 1 other location - About 6 hrs to fix
game_frontend/cypress/integration/user/navigation.spec.js on lines 13..32

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('Teacher user', () => {
before(() => {
cy.login()
cy.addTestGame()
cy.logout()
Severity: Major
Found in game_frontend/cypress/integration/user/navigation.spec.js and 1 other location - About 6 hrs to fix
game_frontend/cypress/integration/user/navigation.spec.js on lines 34..53

File sdk_pb2_grpc.py has 420 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
 
from agones import sdk_pb2 as sdk__pb2
Severity: Minor
Found in aimmo-game/agones/sdk_pb2_grpc.py - About 6 hrs to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

Severity: Major
Found in aimmo-game/simulation/event.py and 1 other location - About 5 hrs to fix
aimmo-game-worker/simulation/event.py on lines 0..19

Identical blocks of code found in 2 locations. Consider refactoring.
Open

Severity: Major
Found in aimmo-game-worker/simulation/event.py and 1 other location - About 5 hrs to fix
aimmo-game/simulation/event.py on lines 0..19

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def next_turn(world_state, avatar_state):
world_state = world_state
avatar_state = avatar_state
 
if world_state.get_cell(avatar_state.location).generates_score:
Severity: Major
Found in aimmo/avatar_examples/winner_avatar.py and 1 other location - About 5 hrs to fix
aimmo/avatar_examples/health_seeker_avatar.py on lines 1..13

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def next_turn(world_state, avatar_state):
world_state = world_state
avatar_state = avatar_state
 
if world_state.get_cell(avatar_state.location).generates_score:
Severity: Major
Found in aimmo/avatar_examples/health_seeker_avatar.py and 1 other location - About 5 hrs to fix
aimmo/avatar_examples/winner_avatar.py on lines 1..13

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('does not reset their code to the default one in the Worksheet if they click on Reset Code and not confirm', () => {
cy.loadGameWithAvatarCode(avatarCode)
cy.on('window:confirm', () => false)
cy.get('button').contains('Reset code').click()
cy.window()
Severity: Major
Found in game_frontend/cypress/integration/user/actions.spec.js and 1 other location - About 4 hrs to fix
game_frontend/cypress/integration/user/actions.spec.js on lines 17..24

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('resets their code to the default one in the Worksheet if they click on Reset Code and confirm', () => {
cy.loadGameWithAvatarCode(avatarCode)
cy.on('window:confirm', () => true)
cy.get('button').contains('Reset code').click()
cy.window()
Severity: Major
Found in game_frontend/cypress/integration/user/actions.spec.js and 1 other location - About 4 hrs to fix
game_frontend/cypress/integration/user/actions.spec.js on lines 26..33

Similar blocks of code found in 2 locations. Consider refactoring.
Open

remove (interactable: DiffItem): void {
const index = interactable.id
const toDelete = this.interactableNode.getChildMeshes(true, function (node): boolean {
return node.name === `interactable: ${index}`
})
Severity: Major
Found in game_frontend/src/babylon/entities/interactableManager.ts and 1 other location - About 3 hrs to fix
game_frontend/src/babylon/entities/obstacleManager.ts on lines 23..31

Similar blocks of code found in 2 locations. Consider refactoring.
Open

remove (obstacle: DiffItem): void {
const index = obstacle.id
const toDelete = this.obstacleNode.getChildMeshes(true, function (node): boolean {
return node.name === `obstacle: ${index}`
})
Severity: Major
Found in game_frontend/src/babylon/entities/obstacleManager.ts and 1 other location - About 3 hrs to fix
game_frontend/src/babylon/entities/interactableManager.ts on lines 26..34

WorldMap has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class WorldMap(object):
"""
The non-player world state.
"""
 
 
Severity: Minor
Found in aimmo-game/simulation/world_map.py - About 3 hrs to fix

File game_manager.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import logging
import secrets
import time
from abc import ABCMeta, abstractmethod
from concurrent import futures
Severity: Minor
Found in aimmo-game-creator/game_manager.py - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('becomes enabled when code is different from the server', () => {
const props = {
whenClicked: jest.fn(),
runCodeButtonStatus: {
status: RunCodeButtonStatus.normal
Severity: Major
Found in game_frontend/src/components/RunCodeButton/index.test.js and 1 other location - About 2 hrs to fix
game_frontend/src/components/RunCodeButton/index.test.js on lines 60..72

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('becomes disabled when code is the same as the server', () => {
const props = {
whenClicked: jest.fn(),
runCodeButtonStatus: {
status: RunCodeButtonStatus.normal
Severity: Major
Found in game_frontend/src/components/RunCodeButton/index.test.js and 1 other location - About 2 hrs to fix
game_frontend/src/components/RunCodeButton/index.test.js on lines 46..58
Severity
Category
Status
Source
Language