hexlet-codebattle/codebattle

View on GitHub

Showing 196 of 679 total issues

Function ControlPanel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function ControlPanel({
  isPlayer,
  searchOption,
  panelMode,
  panelHistory,

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 TaskConfigurationModal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const TaskConfigurationModal = NiceModal.create(() => {
  const dispatch = useDispatch();

  const visibilityInputRef = useRef(null);

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

Avoid too many return statements within this function.
Open

      return isArray(value) && !value.some(item => !isValidValueToSignature(item, signature.nested));

    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 <GameRoomTimer timeoutSeconds={timeoutSeconds} time={time} />;

        Avoid too many return statements within this function.
        Open

              return 'Task Is Invalid';

          Avoid too many return statements within this function.
          Open

                return 'Round 1';

            Avoid too many return statements within this function.
            Open

                return 'Task Builder';

              Avoid too many return statements within this function.
              Open

                    return [true];

                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 gameStatuses[gameStateName];

                    Avoid too many return statements within this function.
                    Open

                          return isBoolean(value);

                      Avoid too many return statements within this function.
                      Open

                            return [false, 'Not valid arguments'];

                        Avoid too many return statements within this function.
                        Open

                              return [false, 'Not valid expected'];

                          Avoid too many return statements within this function.
                          Open

                              return (
                                <>
                                  <FontAwesomeIcon icon="users" />
                                  vs
                                  <FontAwesomeIcon icon="users" />

                            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 'Round 1';

                                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 'Task Testing';

                                    Avoid too many return statements within this function.
                                    Open

                                      return (
                                        <FontAwesomeIcon
                                          title="Unknown tournament type"
                                          icon="question-circle"
                                        />
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language