-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
- Decompose and optimize long functions like this:
Line 167 in 474e802
processCellClick = (x, y) => { - Use intermediate variables instead of multi-line expressions in if-statements:
Line 167 in 474e802
processCellClick = (x, y) => { - Try to combine duplicate code:
Lines 203 to 228 in 474e802
processCellMouseEnter = (event) => { const position = parsePositionFromCell(event.target); if ( (this.player.game.state === gameState.POSITIONING_PLAYER1 && this.player.isFirst) || (this.player.game.state === gameState.POSITIONING_PLAYER2 && !this.player.isFirst) ) { this.renderShip(position.x, position.y, cellState.SHIP); } }; processCellMouseLeave = (event) => { const position = parsePositionFromCell(event.target); if ( (this.player.game.state === gameState.POSITIONING_PLAYER1 && this.player.isFirst) || (this.player.game.state === gameState.POSITIONING_PLAYER2 && !this.player.isFirst) ) { this.renderShip(position.x, position.y, cellState.EMPTY); } }; }
Metadata
Metadata
Assignees
Labels
No labels