Showing 17 of 19 total issues

File sut.ts has 639 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type {
  InitializerArgs,
  InitialStep,
  StepData,
  StepperState,
Severity: Major
Found in src/hook/stepper/test/sut.ts - About 1 day to fix

    Function Select has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    export const Select = ({
      placeholder,
      size = 'medium',
      disabled = false,
      hasError = false,
    Severity: Minor
    Found in src/ui/molecules/select/Select.tsx - About 3 hrs 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 Faucet has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    export const Faucet: React.FC<FaucetProps> = ({ chainId, captcha }: DeepReadonly<FaucetProps>) => {
      const [initiator, setInitiator]: UseState<Initiator> = useState<Initiator>(null)
      const [walletRecaptcha, setWalletRecaptcha]: UseState<boolean> = useState<boolean>(false)
      const [addressRecaptcha, setAddressRecaptcha]: UseState<boolean> = useState<boolean>(false)
      const faucetDispatch = useFaucetDispatch()
    Severity: Minor
    Found in src/ui/organisms/faucet/Faucet.tsx - About 2 hrs 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 stepperReducer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    const stepperReducer = (
      state: DeepReadonly<StepperState>,
      action: DeepReadonly<StepperAction>
    ): DeepReadonly<StepperState> => {
      switch (action.type) {
    Severity: Minor
    Found in src/hook/stepper/useStepper.ts - About 2 hrs 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

    File Faucet.tsx has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useCallback, useMemo, useState } from 'react'
    import keplrImage from 'assets/images/keplr.png'
    import { acknowledgeError } from 'domain/error/usecase/acknowledge-error/acknowledgeError'
    import type { AppState as FaucetAppState } from 'domain/faucet/store/appState'
    import type { AppState as TaskAppState } from 'domain/task/store/appState'
    Severity: Minor
    Found in src/ui/organisms/faucet/Faucet.tsx - About 2 hrs to fix

      Function Stepper has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const Stepper: React.FC<StepperProps> = ({
        steps,
        activeStepId,
        isSubmitDisabled,
        submitButtonLabel,
      Severity: Minor
      Found in src/ui/molecules/stepper/Stepper.tsx - About 1 hr 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 registerTask has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        (registerTaskPayload: DeepReadonly<RegisterTask>): ThunkResult<Promise<void>> =>
        // eslint-disable-next-line @typescript-eslint/typedef
        async (dispatch, getState) => {
          const {
            id,
      Severity: Minor
      Found in src/domain/task/usecase/register-task/registerTask.ts - About 1 hr 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 uploadFiles has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        (uploadFilesPayload: DeepReadonly<UploadFiles>): ThunkResult<Promise<void>> =>
        // eslint-disable-next-line @typescript-eslint/typedef
        async (dispatch, getState, { fileRegistryGateway }) => {
          try {
            const storeParams: StoreParams = { state: getState(), dispatch }
      Severity: Minor
      Found in src/domain/file/usecase/upload-files/uploadFiles.ts - About 1 hr 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 isProgressValid has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      export const isProgressValid = (progress: DeepReadonly<Progress>): boolean => {
        const { max, min, current }: Progress = progress
      
        // force undefined explicit assertion to ensure that 0 and negative values are excluded
        if (current !== undefined) {
      Severity: Minor
      Found in src/domain/task/utils/task.utils.ts - About 1 hr 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 drawBouncingText has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const drawBouncingText = ({
        canvas,
        deltaCount
      }: {
        canvas: HTMLCanvasElement
      Severity: Minor
      Found in stories/atoms/components/canvas/bouncingText.ts - 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

      Consider simplifying this complex logical expression.
      Open

          if (useInit()) {
            const { scene }: WorldTickData = world.latestTickData
            const camera = new ArcRotateCamera(
              options?.name ?? defaultArcRotateCamera.name,
              options?.alpha ?? defaultArcRotateCamera.alpha,
      Severity: Major
      Found in src/ui/molecules/networkGraph/ecs/system/installCameraSystem.ts - About 40 mins to fix

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

          (
            configureTaskProgressBoundsPayload: DeepReadonly<ConfigureTaskProgressBounds>
          ): ThunkResult<Promise<void>> =>
          // eslint-disable-next-line @typescript-eslint/typedef
          async (dispatch, getState) => {

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

        export const FileInput: React.FC<FileInputProps> = ({
          label,
          description,
          multiple = true,
          acceptedFormats,
        Severity: Minor
        Found in src/ui/atoms/fileInput/FileInput.tsx - 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

        Avoid too many return statements within this function.
        Open

              return {
                ...state,
                steps: state.steps.set(activeId, { ...activeStep, status: 'completed' })
              }
        Severity: Major
        Found in src/hook/stepper/useStepper.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return true
          Severity: Major
          Found in src/domain/task/utils/task.utils.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    ...(payloadIsOk && {
                      steps: state.steps
                        .map((step: DeepReadonly<StepData>) => ({
            Severity: Major
            Found in src/hook/stepper/useStepper.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                if (min !== undefined && max !== undefined) return min < max
              Severity: Major
              Found in src/domain/task/utils/task.utils.ts - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language