hexlet-codebattle/codebattle

View on GitHub

Showing 200 of 693 total issues

Function solution has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def solution(numerator, denominator, _string, _float, _bool, _hash, _list_str, _list_list_str):
Severity: Major
Found in services/app/apps/runner/dockers/python/check/solution.py - About 1 hr to fix

    Method solution has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    fun solution(a: Int, b: Int, c: String, d: Double, e: Boolean, f: Map<String, String>, g: List<String>, h: List<List<String>>): Int {
    Severity: Major
    Found in services/app/apps/runner/dockers/kotlin/check/solution.kt - About 1 hr to fix

      Method AssertSolution has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          static bool AssertSolution(object result, object expected, IList<object> args, string output, double executionTime, IList<AssertResult> executionResults, CompareLogic compareLogic, bool success)
      Severity: Major
      Found in services/app/apps/runner/dockers/csharp/check/Checker.cs - About 1 hr to fix

        Function Output has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        const Output = ({ fontSize, sideOutput, hideContent }) => {
          if (hideContent) {
            return <></>;
          }
        
        
        Severity: Minor
        Found in services/app/apps/codebattle/assets/js/widgets/pages/game/Output.jsx - About 55 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 useEditorCursor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        const useEditorCursor = editor => {
          const handleChangeCursorSelection = useCallback(e => {
            const { readOnly, canSendCursor } = editor.getRawOptions();
        
            if (!canSendCursor) {
        Severity: Minor
        Found in services/app/apps/codebattle/assets/js/widgets/utils/useEditorCursor.js - About 55 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 StageStatus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        function StageStatus({
          playerId,
          matchList,
          matchState,
        }) {

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

        function TournamentAdminWidget({ waitingRoomMachine }) {
          const dispatch = useDispatch();
        
          const searchParams = useSearchParams();
        
        

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

        const TournamentMainControlButtons = ({
          accessType,
          streamMode,
          tournamentId,
          canStart,

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

        function InvitesContainer() {
          const dispatch = useDispatch();
        
          const followId = useSelector(state => state.gameUI.followId);
          const followPaused = useSelector(state => state.gameUI.followPaused);

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

        const useCursorUpdates = (editor, monaco, props) => {
          const params = useMemo(
            () => pick(props, ['userId', 'roomMode']),
        
            // eslint-disable-next-line react-hooks/exhaustive-deps
        Severity: Minor
        Found in services/app/apps/codebattle/assets/js/widgets/utils/useCursorUpdates.js - About 45 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 TournamentStatisticsModal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const TournamentStatisticsModal = NiceModal.create(() => {
          const modal = useModal(ModalCodes.tournamentStatisticsModal);
        
          const gameId = useSelector(gameIdSelector);
          const tournament = useSelector(tournamentSelector);

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

        function BuilderEditorsWidget() {
          const dispatch = useDispatch();
          const { taskService } = useContext(RoomContext);
        
          const [assertsPanelShowing, setAssertsPanelShowing] = useState(false);

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

        function BuilderExampleForm() {
          const dispatch = useDispatch();
          const { taskService } = useContext(RoomContext);
        
          const argumentsTabRef = 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

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

        function TournamentType({ type }) {
          if (type === TournamentTypeCodes.versus) {
            return 'Versus';
          }
        
        

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

        function TournamentPlayer({ spectatorMachine, waitingRoomMachine }) {
          const dispatch = useDispatch();
        
          const searchParams = useSearchParams();
        
        

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

        export const editorDataSelector = (playerId, roomMachineState) => state => {
          const meta = editorsMetaSelector(state)[playerId];
          const editorTexts = editorTextsSelector(state);
          const editorTextsHistory = editorTextsHistorySelector(state);
        
        
        Severity: Minor
        Found in services/app/apps/codebattle/assets/js/widgets/selectors/index.js - About 35 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 OutputTab has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const OutputTab = ({ sideOutput, large = false }) => {
          const { successCount, assertsCount, status } = sideOutput;
          const isShowMessage = status === 'failure';
          const statusColor = color[status];
          const message = getMessage(status);
        Severity: Minor
        Found in services/app/apps/codebattle/assets/js/widgets/pages/game/OutputTab.jsx - About 35 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 initTournamentChannel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const initTournamentChannel = (waitingRoomMachine, currentChannel) => dispatch => {
          const onJoinFailure = err => {
            console.error(err);
            // window.location.reload();
          };
        Severity: Minor
        Found in services/app/apps/codebattle/assets/js/widgets/middlewares/Tournament.js - About 35 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 EmojiTooltip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function EmojiTooltip({ colons, handleSelect, hide }) {
          const [activeIndex, setActiveIndex] = useState(0);
          const [emojis, setEmojis] = useState([]);
        
          const increaseIndex = () => {

        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