hexlet-codebattle/codebattle

View on GitHub

Showing 493 of 690 total issues

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomPlayerMatchmakingPaused = response => {
      waitingRoomMachine.send(
        channelTopics.waitingRoomPlayerMatchmakingPausedTopic,
        { payload: response },
      );
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 10..16
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 18..24
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 26..32
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 34..40
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 42..49
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 60..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomEnded = response => {
      waitingRoomMachine.send(channelTopics.waitingRoomEndedTopic, {
        payload: response,
      });

services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 10..16
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 26..32
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 34..40
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 42..49
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 60..67
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 69..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomPlayerBanned = response => {
      waitingRoomMachine.send(channelTopics.waitingRoomPlayerBannedTopic, {
        payload: response,
      });

services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 10..16
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 18..24
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 34..40
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 42..49
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 60..67
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 69..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomPlayerMatchmakingStopped = response => {
      waitingRoomMachine.send(
        channelTopics.waitingRoomPlayerMatchmakingStoppedTopic,
        { payload: response },
      );
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 10..16
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 18..24
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 26..32
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 34..40
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 42..49
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 69..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomPlayerMatchmakingStarted = response => {
      waitingRoomMachine.send(
        channelTopics.waitingRoomPlayerMatchmakingStartedTopic,
        { payload: response },
      );
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 10..16
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 18..24
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 26..32
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 34..40
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 60..67
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 69..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomStarted = response => {
      waitingRoomMachine.send(channelTopics.waitingRoomStartedTopic, {
        payload: response,
      });

services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 18..24
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 26..32
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 34..40
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 42..49
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 60..67
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 69..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    const handleWaitingRoomPlayerUnbanned = response => {
      waitingRoomMachine.send(channelTopics.waitingRoomPlayerUnbannedTopic, {
        payload: response,
      });

services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 10..16
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 18..24
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 26..32
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 42..49
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 51..58
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 60..67
services/app/apps/codebattle/assets/js/widgets/middlewares/WaitingRoom.js on lines 69..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          <SpectatorEditor
            panelClassName="spectator h-100 p-1"
            switchedWidgetsStatus={switchedWidgetsStatus}
            handleSwitchWidgets={handleSwitchWidgets}
            hidingControls={hidingControls}
services/app/apps/codebattle/assets/js/widgets/pages/tournamentPlayer/TournamentPlayer.jsx on lines 390..398

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <SpectatorEditor
        panelClassName="spectator h-100 p-1 overflow-hidden"
        switchedWidgetsStatus={switchedWidgetsStatus}
        handleSwitchWidgets={handleSwitchWidgets}
        hidingControls={hidingControls}
services/app/apps/codebattle/assets/js/widgets/pages/tournamentPlayer/TournamentPlayer.jsx on lines 422..430

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <Modal.Header closeButton>
        <Modal.Title>{i18next.t('Tournament description')}</Modal.Title>
      </Modal.Header>
services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentAwardModal.jsx on lines 47..49

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <Modal.Header closeButton>
        <Modal.Title>{i18next.t('Award')}</Modal.Title>
      </Modal.Header>
services/app/apps/codebattle/assets/js/widgets/pages/tournament/TournamentDescriptionModal.jsx on lines 25..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const pushCommand = command => {
  channel
    .push(channelMethods.chatCommand, command)
    .receive('error', error => console.error(error));
};
services/app/apps/codebattle/assets/js/widgets/middlewares/Lobby.js on lines 98..102
services/app/apps/codebattle/assets/js/widgets/middlewares/Lobby.js on lines 104..108

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  const openUploadTaskModal = useCallback(() => {
    NiceModal.show(ModalCodes.taskParamsModal, { mode: modalModes.editJSON, action: modalActions.upload });
  }, []);
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 150..152
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 153..155

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const createGame = params => {
  channel
    .push(channelMethods.gameCreate, params)
    .receive('error', error => console.error(error));
};
services/app/apps/codebattle/assets/js/widgets/middlewares/Chat.js on lines 76..80
services/app/apps/codebattle/assets/js/widgets/middlewares/Lobby.js on lines 104..108

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  const openEditTaskModal = useCallback(() => {
    NiceModal.show(ModalCodes.taskParamsModal, { mode: modalModes.editJSON, action: modalActions.edit });
  }, []);
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 147..149
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 150..152

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const createInvite = invite => {
  channel
    .push(channelMethods.gameCreateInvite, invite)
    .receive('error', error => console.error(error));
};
services/app/apps/codebattle/assets/js/widgets/middlewares/Chat.js on lines 76..80
services/app/apps/codebattle/assets/js/widgets/middlewares/Lobby.js on lines 98..102

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  const openCopyTaskModal = useCallback(() => {
    NiceModal.show(ModalCodes.taskParamsModal, { mode: modalModes.showJSON, action: modalActions.copy });
  }, []);
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 147..149
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 153..155

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const getGameStatus = ({
  id,
  state,
  startsAt,
  type,
services/app/apps/codebattle/assets/js/widgets/pages/tournament/StageCard.jsx on lines 104..239

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      {canPublish && (
        <button
          type="button"
          className="btn btn-md btn-primary text-nowrap rounded-bottom mb-2"
          onClick={handlePublishTask}
services/app/apps/codebattle/assets/js/widgets/pages/builder/BuilderActions.jsx on lines 227..236

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <div className="input-group-prepend">
              <span className="input-group-text" id="search-icon">
                <FontAwesomeIcon icon="search" />
              </span>
            </div>
services/app/apps/codebattle/assets/js/widgets/pages/rating/RatingList.jsx on lines 165..169

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language