kanyuga/killer-counter

View on GitHub

Showing 5 of 30 total issues

Function render has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

render() {
let display;
const playerForm = <PlayerForm />;
if (this.props.started) {
if (this.gameOver()) {
Severity: Major
Found in src/App.js - About 3 hrs to fix

    Function render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    render() {
    let display;
    const playerForm = <PlayerForm />;
    if (this.props.started) {
    if (this.gameOver()) {
    Severity: Minor
    Found in src/App.js - About 2 hrs to fix

    Function play has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function play(state = initialState, action) {
    const newState = {...state};
    const currentPlayer = Helpers.getCurrentPlayer(newState.players);
    const currentBall = Helpers.getCurrentBall(newState.balls);
    let portedBall;
    Severity: Major
    Found in src/reducers.js - About 2 hrs to fix

      Function PlayerList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      let PlayerList = (props) => {
      let players = props.players.slice();
      const isLeaderboard = props.hasOwnProperty('sorted');
      if (isLeaderboard) {
      players = players.sort((player1, player2) => player2.score - player1.score);
      Severity: Minor
      Found in src/components/PlayerList.js - About 1 hr to fix

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

        export function defaultGameState(ballCount = 15) {
         
        const balls = {};
         
        for (let i = 1; i <= ballCount; i++) {
        Severity: Minor
        Found in src/helpers.js - About 25 mins to fix
        Severity
        Category
        Status
        Source
        Language