yassinedoghri/marvel-jarvig

View on GitHub
src/reducers/reducer-jarvig.js

Summary

Maintainability
B
5 hrs
Test Coverage
B
83%

Avoid too many return statements within this function.
Open

      return {
        ...state,
        game: {
          ...state.game,
          result: [...state.game.result, action.payload ? "1" : "0"], // set 1 if correct, 0 if not
Severity: Major
Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return {
            ...state,
            game: {
              ...state.game,
              choices: null,
    Severity: Major
    Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return {
              ...state,
              game: {
                ...state.game,
                over: true
      Severity: Major
      Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return {
                ...state,
                game: {
                  ...state.game,
                  time: action.payload
        Severity: Major
        Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return {
                  ...state,
                  fetching: false,
                  error: null,
                  characters: action.payload,
          Severity: Major
          Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state
                  };
            Severity: Major
            Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return { ...state, fetching: true, error: null };
              Severity: Major
              Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return {
                        ...state,
                        game: {
                          ...state.game,
                          result: [...state.game.result, "0"], // set 0 as "wrong answer" because passed
                Severity: Major
                Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return {
                          ...state,
                          game: {
                            ...state.game,
                            selected: action.payload
                  Severity: Major
                  Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return { ...state, fetching: false, error: action.payload };
                    Severity: Major
                    Found in src/reducers/reducer-jarvig.js - About 30 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status