portainer/portainer

View on GitHub

Showing 3,440 of 3,440 total issues

Function useInitialValues has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function useInitialValues(submitting: boolean, isWindows: boolean) {
  const {
    params: { nodeName, from },
  } = useCurrentStateAndParams();
  const environmentId = useEnvironmentId();
Severity: Major
Found in app/react/docker/containers/CreateView/useInitialValues.ts - About 3 hrs to fix

    Function KubeConfigTeaserForm has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function KubeConfigTeaserForm() {
      const kubeConfigImportDocUrl = useDocsUrl(
        '/admin/environments/add/kubernetes/import'
      );
    
    

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

      func (handler *Handler) handleAttachRequest(w http.ResponseWriter, r *http.Request, params *webSocketRequestParams) error {
          tokenData, err := security.RetrieveTokenData(r)
          if err != nil {
              log.Warn().
                  Err(err).
      Severity: Major
      Found in api/http/handler/websocket/attach.go and 1 other location - About 3 hrs to fix
      api/http/handler/websocket/exec.go on lines 81..106

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

      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

      func (handler *Handler) handleExecRequest(w http.ResponseWriter, r *http.Request, params *webSocketRequestParams) error {
          tokenData, err := security.RetrieveTokenData(r)
          if err != nil {
              log.Warn().
                  Err(err).
      Severity: Major
      Found in api/http/handler/websocket/exec.go and 1 other location - About 3 hrs to fix
      api/http/handler/websocket/attach.go on lines 78..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 256.

      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

          if (statefulSet.MemoryLimit) {
            payload.spec.template.spec.containers[0].resources.limits.memory = statefulSet.MemoryLimit;
            payload.spec.template.spec.containers[0].resources.requests.memory = statefulSet.MemoryLimit;
          }
      Severity: Major
      Found in app/kubernetes/converters/statefulSet.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 195..198
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

          if (deployment.CpuLimit) {
            payload.spec.template.spec.containers[0].resources.limits.cpu = deployment.CpuLimit;
            payload.spec.template.spec.containers[0].resources.requests.cpu = deployment.CpuLimit;
          }
      Severity: Major
      Found in app/kubernetes/converters/deployment.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 195..198
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

          if (daemonSet.CpuLimit) {
            payload.spec.template.spec.containers[0].resources.limits.cpu = daemonSet.CpuLimit;
            payload.spec.template.spec.containers[0].resources.requests.cpu = daemonSet.CpuLimit;
          }
      Severity: Major
      Found in app/kubernetes/converters/daemonSet.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 195..198
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

          if (statefulSet.CpuLimit) {
            payload.spec.template.spec.containers[0].resources.limits.cpu = statefulSet.CpuLimit;
            payload.spec.template.spec.containers[0].resources.requests.cpu = statefulSet.CpuLimit;
          }
      Severity: Major
      Found in app/kubernetes/converters/statefulSet.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/pod/converter.js on lines 195..198
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

        if (pod.MemoryLimit) {
          payload.spec.template.spec.containers[0].resources.limits.memory = pod.MemoryLimit;
          payload.spec.template.spec.containers[0].resources.requests.memory = pod.MemoryLimit;
        }
      Severity: Major
      Found in app/kubernetes/pod/converter.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

        isQuotaValid() {
          if (
            this.state.sliderMaxCpu < this.formValues.CpuLimit ||
            this.state.sliderMaxMemory < this.formValues.MemoryLimit ||
            (this.formValues.CpuLimit === 0 && this.formValues.MemoryLimit === 0)
      app/kubernetes/views/resource-pools/create/createResourcePoolController.js on lines 87..96

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

      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

        isQuotaValid() {
          if (
            this.state.sliderMaxCpu < this.formValues.CpuLimit ||
            this.state.sliderMaxMemory < this.formValues.MemoryLimit ||
            (this.formValues.CpuLimit === 0 && this.formValues.MemoryLimit === 0)
      app/kubernetes/views/resource-pools/edit/resourcePoolController.js on lines 109..118

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

      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

          if (daemonSet.MemoryLimit) {
            payload.spec.template.spec.containers[0].resources.limits.memory = daemonSet.MemoryLimit;
            payload.spec.template.spec.containers[0].resources.requests.memory = daemonSet.MemoryLimit;
          }
      Severity: Major
      Found in app/kubernetes/converters/daemonSet.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 195..198
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

        if (pod.CpuLimit) {
          payload.spec.template.spec.containers[0].resources.limits.cpu = pod.CpuLimit;
          payload.spec.template.spec.containers[0].resources.requests.cpu = pod.CpuLimit;
        }
      Severity: Major
      Found in app/kubernetes/pod/converter.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 74..77
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 195..198

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

      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

          if (deployment.MemoryLimit) {
            payload.spec.template.spec.containers[0].resources.limits.memory = deployment.MemoryLimit;
            payload.spec.template.spec.containers[0].resources.requests.memory = deployment.MemoryLimit;
          }
      Severity: Major
      Found in app/kubernetes/converters/deployment.js and 7 other locations - About 3 hrs to fix
      app/kubernetes/converters/daemonSet.js on lines 66..69
      app/kubernetes/converters/daemonSet.js on lines 70..73
      app/kubernetes/converters/deployment.js on lines 78..81
      app/kubernetes/converters/statefulSet.js on lines 74..77
      app/kubernetes/converters/statefulSet.js on lines 78..81
      app/kubernetes/pod/converter.js on lines 195..198
      app/kubernetes/pod/converter.js on lines 199..202

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

      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

            <FormControl
              inputId="edge_checkin_ping"
              label={fieldSettings.ping.label}
              tooltip={fieldSettings.ping.tooltip}
            >
      Severity: Major
      Found in app/react/edge/components/EdgeAsyncIntervalsForm.tsx and 2 other locations - About 3 hrs to fix
      app/react/edge/components/EdgeAsyncIntervalsForm.tsx on lines 107..120
      app/react/edge/components/EdgeAsyncIntervalsForm.tsx on lines 122..135

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

      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

            <FormControl
              inputId="edge_checkin_command"
              label={fieldSettings.command.label}
              tooltip={fieldSettings.command.tooltip}
            >
      Severity: Major
      Found in app/react/edge/components/EdgeAsyncIntervalsForm.tsx and 2 other locations - About 3 hrs to fix
      app/react/edge/components/EdgeAsyncIntervalsForm.tsx on lines 92..105
      app/react/edge/components/EdgeAsyncIntervalsForm.tsx on lines 107..120

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

      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

              columnHelper.accessor('Image', {
                header: 'Image',
                cell: ({ row: { original: item } }) => (
                  <>
                    {truncate(item.Image, 64)}
      Severity: Major
      Found in app/react/kubernetes/namespaces/ItemView/columns.tsx and 2 other locations - About 3 hrs to fix
      app/react/kubernetes/cluster/NodeView/NodeApplicationsDatatable/columns.tsx on lines 42..52
      app/react/kubernetes/components/IntegratedAppsDatatable/columns.tsx on lines 13..21

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

      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 4 locations. Consider refactoring.
      Open

      export function useDeleteEdgeStacksMutation() {
        const queryClient = useQueryClient();
        return useMutation(
          (edgeStackIds: Array<EdgeStack['Id']>) =>
            promiseSequence(
      app/react/edge/edge-groups/ListView/useDeleteEdgeGroupMutation.ts on lines 15..27
      app/react/edge/edge-jobs/ListView/useDeleteEdgeJobsMutation.ts on lines 15..27
      app/react/portainer/registries/ListView/RegistriesDatatable/useDeleteRegistriesMutation.ts on lines 15..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 97.

      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 4 locations. Consider refactoring.
      Open

      export function useDeleteEdgeJobsMutation() {
        const queryClient = useQueryClient();
        return useMutation(
          (edgeJobIds: Array<EdgeJob['Id']>) =>
            promiseSequence(
      app/react/edge/edge-groups/ListView/useDeleteEdgeGroupMutation.ts on lines 15..27
      app/react/edge/edge-stacks/ListView/EdgeStacksDatatable/useDeleteEdgeStacksMutation.ts on lines 15..27
      app/react/portainer/registries/ListView/RegistriesDatatable/useDeleteRegistriesMutation.ts on lines 15..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 97.

      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 4 locations. Consider refactoring.
      Open

      export function useDeleteRegistriesMutation() {
        const queryClient = useQueryClient();
        return useMutation(
          (RegistryIds: Array<Registry['Id']>) =>
            promiseSequence(
      app/react/edge/edge-groups/ListView/useDeleteEdgeGroupMutation.ts on lines 15..27
      app/react/edge/edge-jobs/ListView/useDeleteEdgeJobsMutation.ts on lines 15..27
      app/react/edge/edge-stacks/ListView/EdgeStacksDatatable/useDeleteEdgeStacksMutation.ts on lines 15..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 97.

      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