Showing 19 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

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

    export class TaskStoreBuilder {
      private readonly taskStoreParameters: TaskStoreParameters
    
      constructor(
        taskStoreParameters: DeepReadonly<TaskStoreParameters> = {
    Severity: Major
    Found in src/domain/task/store/builder/store.builder.ts and 1 other location - About 1 day to fix
    src/domain/error/store/builder/store.builder.ts on lines 11..69

    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 396.

    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 class ErrorStoreBuilder {
      private readonly errorStoreParameters: ErrorStoreParameters
    
      constructor(
        errorStoreParameters: DeepReadonly<ErrorStoreParameters> = {
    Severity: Major
    Found in src/domain/error/store/builder/store.builder.ts and 1 other location - About 1 day to fix
    src/domain/task/store/builder/store.builder.ts on lines 11..69

    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 396.

    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

    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