hexlet-codebattle/codebattle

View on GitHub

Showing 200 of 693 total issues

Avoid too many return statements within this function.
Open

    return null;
Severity: Major
Found in services/app/apps/codebattle/assets/js/widgets/pages/game/GameResult.jsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return (
        <FontAwesomeIcon
          title="Unknown tournament type"
          icon="question-circle"
        />

      Avoid too many return statements within this function.
      Open

            return [false, 'Not valid arguments'];

        Avoid too many return statements within this function.
        Open

            return { ...acc, players: newPlayers, records: [...records, newRecord] };
        Severity: Major
        Found in services/app/apps/codebattle/assets/js/widgets/lib/player.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return 'Round 4';

            Avoid too many return statements within this function.
            Open

                  return false;

              Avoid too many return statements within this function.
              Open

                    return [true];

                Avoid too many return statements within this function.
                Open

                  return { ...acc, records: [...records, newRecord] };
                Severity: Major
                Found in services/app/apps/codebattle/assets/js/widgets/lib/player.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return (
                        <>
                          <FontAwesomeIcon icon="user" />
                          <FontAwesomeIcon icon="sort-amount-up" />
                        </>

                    Avoid too many return statements within this function.
                    Open

                        return { ...acc, chat: newChatState, records: [...records, newRecord] };
                    Severity: Major
                    Found in services/app/apps/codebattle/assets/js/widgets/lib/player.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return [true, ''];

                        Avoid too many return statements within this function.
                        Open

                            return (
                              <button
                                type="button"
                                className={`btn btn-orange btn-sm ${type === 'table' ? 'ml-1 px-4' : ''} rounded-lg`}
                                data-method="post"

                          Avoid too many return statements within this function.
                          Open

                                  return 'Round 2';

                            Avoid too many return statements within this function.
                            Open

                                  return [false, 'Only lowercase latin'];

                              Avoid too many return statements within this function.
                              Open

                                    return 'Round 1';

                                Avoid too many return statements within this function.
                                Open

                                  return null;

                                  Avoid too many return statements within this function.
                                  Open

                                        return [false, 'Name must be unig'];

                                    Avoid too many return statements within this function.
                                    Open

                                          return 0;

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

                                          updateEditorLang: (state, { payload }) => {
                                            state.activeGames = state.activeGames.map(game => {
                                              if (game.id === payload.gameId) {
                                                const newPlayers = game.players.map(player => (
                                                  player.id === payload.userId
                                      Severity: Minor
                                      Found in services/app/apps/codebattle/assets/js/widgets/slices/lobby.js - About 25 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

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

                                      function TournamentStateDescription({
                                        state,
                                        startsAt,
                                        breakState,
                                        breakDurationSeconds,

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language