nunof07/phaser-breakout

View on GitHub

Showing 6 of 6 total issues

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

export function lowestY(bricks: ReadonlyArray<Brick>, defaultValue: number): number {
return bricks.length === 0
? defaultValue
: bricks.reduce((prev: Brick, curr: Brick) => prev.sprite().y > curr.sprite().y ? prev : curr)
.sprite().y;
Severity: Major
Found in src/systems/bricks/lowestY.ts and 1 other location - About 4 hrs to fix
src/systems/bricks/highestY.ts on lines 8..13

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

export function highestY(bricks: ReadonlyArray<Brick>, defaultValue: number): number {
return bricks.length === 0
? defaultValue
: bricks.reduce((prev: Brick, curr: Brick) => prev.sprite().y < curr.sprite().y ? prev : curr)
.sprite().y;
Severity: Major
Found in src/systems/bricks/highestY.ts and 1 other location - About 4 hrs to fix
src/systems/bricks/lowestY.ts on lines 8..13

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

export function startX(sprite: Phaser.Physics.Arcade.Sprite): number {
return sprite.x - sprite.displayOriginX;
}
Severity: Minor
Found in src/display/startX.ts and 1 other location - About 50 mins to fix
src/display/startY.ts on lines 7..9

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

export function gameHeight(game: Phaser.Game): number {
return (<{ height: number }>game.config).height;
}
Severity: Minor
Found in src/game/gameHeight.ts and 1 other location - About 50 mins to fix
src/game/gameWidth.ts on lines 7..9

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

export function gameWidth(game: Phaser.Game): number {
return (<{ width: number }>game.config).width;
}
Severity: Minor
Found in src/game/gameWidth.ts and 1 other location - About 50 mins to fix
src/game/gameHeight.ts on lines 7..9

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

export function startY(sprite: Phaser.Physics.Arcade.Sprite): number {
return sprite.y - sprite.displayOriginY;
}
Severity: Minor
Found in src/display/startY.ts and 1 other location - About 50 mins to fix
src/display/startX.ts on lines 7..9
Severity
Category
Status
Source
Language