portainer/portainer

View on GitHub

Showing 3,440 of 3,440 total issues

Avoid too many return statements within this function.
Open

  return undefined;
Severity: Major
Found in app/portainer/authorization-guard.ts - About 30 mins to fix

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

    func NewHandler(bouncer security.BouncerService) *Handler {
        h := &Handler{
            Router: mux.NewRouter(),
        }
        h.Handle("/upload/tls/{certificate:(?:ca|cert|key)}",
    Severity: Major
    Found in api/http/handler/upload/handler.go and 3 other locations - About 30 mins to fix
    api/http/handler/ldap/handler.go on lines 24..33
    api/http/handler/motd/handler.go on lines 16..24
    api/http/handler/roles/handler.go on lines 20..28

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

    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

    func NewHandler(bouncer security.BouncerService) *Handler {
        h := &Handler{
            Router: mux.NewRouter(),
        }
        h.Handle("/roles",
    Severity: Major
    Found in api/http/handler/roles/handler.go and 3 other locations - About 30 mins to fix
    api/http/handler/ldap/handler.go on lines 24..33
    api/http/handler/motd/handler.go on lines 16..24
    api/http/handler/upload/handler.go on lines 20..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 100.

    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

    func NewHandler(bouncer security.BouncerService) *Handler {
        h := &Handler{
            Router: mux.NewRouter(),
        }
        h.Handle("/motd",
    Severity: Major
    Found in api/http/handler/motd/handler.go and 3 other locations - About 30 mins to fix
    api/http/handler/ldap/handler.go on lines 24..33
    api/http/handler/roles/handler.go on lines 20..28
    api/http/handler/upload/handler.go on lines 20..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 100.

    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

    Avoid too many return statements within this function.
    Open

          return $state.target('portainer.home');
    Severity: Major
    Found in app/portainer/authorization-guard.ts - About 30 mins to fix

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

      func NewHandler(bouncer security.BouncerService) *Handler {
          h := &Handler{
              Router: mux.NewRouter(),
          }
      
      
      Severity: Major
      Found in api/http/handler/ldap/handler.go and 3 other locations - About 30 mins to fix
      api/http/handler/motd/handler.go on lines 16..24
      api/http/handler/roles/handler.go on lines 20..28
      api/http/handler/upload/handler.go on lines 20..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 100.

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

      export class KubernetesApplicationPort {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesApplicationPort)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/application/models/index.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

      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

              if slices.Contains(endpointsFromGroups, endpointID) {
                  edgeJob.GroupLogsCollection[endpointID] = portainer.EdgeJobEndpointMeta{
                      CollectLogs: false,
                      LogsStatus:  portainer.EdgeJobLogsStatusIdle,
                  }
      Severity: Minor
      Found in api/http/handler/edgejobs/edgejob_tasklogs_clear.go and 1 other location - About 30 mins to fix
      api/http/handler/edgejobs/edgejob_tasklogs_collect.go on lines 55..65

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

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

      export class KubernetesEvent {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesEvent)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/event/models.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesPersistentVolumClaimCreatePayload {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesPersistentVolumClaimCreatePayload)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/volume/payloads.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesHorizontalPodAutoScaler {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesHorizontalPodAutoScaler)));
        }
      }
      Severity: Major
      Found in app/kubernetes/horizontal-pod-auto-scaler/models.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesStorageClassCreatePayload {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesStorageClassCreatePayload)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/storage-class/payload.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesApplicationSecret {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesApplicationSecret)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/secret/models.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesDeploymentCreatePayload {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesDeploymentCreatePayload)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/deployment/payloads.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesConfigurationFormValuesEntry {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesConfigurationFormValuesEntry)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/configuration/formvalues.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesNodeTaint {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNodeTaint)));
        }
      }
      Severity: Major
      Found in app/kubernetes/node/models.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesEndpoint {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesEndpoint)));
        }
      }
      Severity: Major
      Found in app/kubernetes/endpoint/models.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

      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 (m *Migrator) kubeconfigExpiryToDB32() error {
          log.Info().Msg("updating kubeconfig expiry")
      
          settings, err := m.settingsService.Settings()
          if err != nil {
      Severity: Minor
      Found in api/datastore/migrator/migrate_dbversion31.go and 1 other location - About 30 mins to fix
      api/datastore/migrator/migrate_dbversion31.go on lines 275..285

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

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

      export class KubernetesApplicationAutoScalerFormValue {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesApplicationAutoScalerFormValue)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/application/formValues.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/common/payloads.js on lines 11..15
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

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

      export class KubernetesCommonMetadataPayload {
        constructor() {
          Object.assign(this, JSON.parse(JSON.stringify(_KubernetesCommonMetadataPayload)));
        }
      }
      Severity: Major
      Found in app/kubernetes/models/common/payloads.js and 34 other locations - About 30 mins to fix
      app/kubernetes/endpoint/models.js on lines 14..18
      app/kubernetes/endpoint/models.js on lines 25..29
      app/kubernetes/horizontal-pod-auto-scaler/models.js on lines 19..23
      app/kubernetes/models/application/formValues.js on lines 140..144
      app/kubernetes/models/application/models/index.js on lines 37..41
      app/kubernetes/models/application/payloads.js on lines 138..142
      app/kubernetes/models/config-map/models.js on lines 27..31
      app/kubernetes/models/config-map/payloads.js on lines 25..29
      app/kubernetes/models/configuration/formvalues.js on lines 32..36
      app/kubernetes/models/configuration/models.js on lines 20..24
      app/kubernetes/models/daemon-set/models.js on lines 21..25
      app/kubernetes/models/daemon-set/payloads.js on lines 46..50
      app/kubernetes/models/deployment/models.js on lines 22..26
      app/kubernetes/models/deployment/payloads.js on lines 48..52
      app/kubernetes/models/event/models.js on lines 12..16
      app/kubernetes/models/namespace/payloads.js on lines 10..14
      app/kubernetes/models/port/models.js on lines 30..34
      app/kubernetes/models/resource-reservation/models.js on lines 9..13
      app/kubernetes/models/secret/models.js on lines 18..22
      app/kubernetes/models/secret/payloads.js on lines 29..33
      app/kubernetes/models/service/models.js on lines 30..34
      app/kubernetes/models/service/models.js on lines 69..73
      app/kubernetes/models/service/payloads.js on lines 18..22
      app/kubernetes/models/stack/models.js on lines 10..14
      app/kubernetes/models/stateful-set/models.js on lines 24..28
      app/kubernetes/models/stateful-set/payloads.js on lines 48..52
      app/kubernetes/models/storage-class/payload.js on lines 12..16
      app/kubernetes/models/volume/payloads.js on lines 19..23
      app/kubernetes/node/models.js on lines 58..62
      app/kubernetes/node/payload.js on lines 15..19
      app/kubernetes/node/payload.js on lines 27..31
      app/kubernetes/pod/models/index.js on lines 39..43
      app/kubernetes/pod/models/index.js on lines 62..66
      app/kubernetes/pod/models/index.js on lines 77..81

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

      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