portainer/portainer

View on GitHub

Showing 3,440 of 3,440 total issues

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

export class KubernetesDaemonSetCreatePayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesDaemonSetCreatePayload)));
  }
}
Severity: Major
Found in app/kubernetes/models/daemon-set/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/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: true,
                LogsStatus:  portainer.EdgeJobLogsStatusPending,
            }
Severity: Minor
Found in api/http/handler/edgejobs/edgejob_tasklogs_collect.go and 1 other location - About 30 mins to fix
api/http/handler/edgejobs/edgejob_tasklogs_clear.go on lines 43..53

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 KubernetesServicePort {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesServicePort)));
  }
}
Severity: Major
Found in app/kubernetes/models/service/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/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 KubernetesDaemonSet {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesDaemonSet)));
  }
}
Severity: Major
Found in app/kubernetes/models/daemon-set/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/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 KubernetesApplicationEnvSecretPayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesApplicationEnvSecretPayload)));
  }
}
Severity: Major
Found in app/kubernetes/models/application/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/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 KubernetesEndpointSubset {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesEndpointSubset)));
  }
}
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 14..18
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 35 locations. Consider refactoring.
Open

export class KubernetesSecretUpdatePayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesSecretUpdatePayload)));
  }
}
Severity: Major
Found in app/kubernetes/models/secret/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/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 KubernetesConfigMapUpdatePayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesConfigMapUpdatePayload)));
  }
}
Severity: Major
Found in app/kubernetes/models/config-map/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/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 KubernetesNodeCreatePayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNodeCreatePayload)));
  }
}
Severity: Major
Found in app/kubernetes/node/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/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 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 KubernetesPodToleration {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesPodToleration)));
  }
}
Severity: Major
Found in app/kubernetes/pod/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/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 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 KubernetesNamespaceCreatePayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNamespaceCreatePayload)));
  }
}
Severity: Major
Found in app/kubernetes/models/namespace/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/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 KubernetesStatefulSet {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesStatefulSet)));
  }
}
Severity: Major
Found in app/kubernetes/models/stateful-set/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/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 KubernetesService {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesService)));
  }
}
Severity: Major
Found in app/kubernetes/models/service/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 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 KubernetesDeployment {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesDeployment)));
  }
}
Severity: Major
Found in app/kubernetes/models/deployment/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/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 KubernetesConfigMap {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesConfigMap)));
  }
}
Severity: Major
Found in app/kubernetes/models/config-map/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/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 KubernetesPodContainer {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesPodContainer)));
  }
}
Severity: Major
Found in app/kubernetes/pod/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/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 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 KubernetesPodEviction {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesPodEviction)));
  }
}
Severity: Major
Found in app/kubernetes/pod/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/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

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

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

    function automaticUpdatesLabel(repositoryAutomaticUpdates, repositoryMechanism) {
      switch (repositoryAutomaticUpdates && repositoryMechanism) {
        case RepositoryMechanismTypes.INTERVAL:
          return 'polling';
        case RepositoryMechanismTypes.WEBHOOK:
app/kubernetes/views/deploy/deployController.js on lines 146..155

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) helmRepositoryURLToDB32() error {
    log.Info().Msg("setting default helm repository URL")

    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 263..273

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 KubernetesStatefulSetCreatePayload {
  constructor() {
    Object.assign(this, JSON.parse(JSON.stringify(_KubernetesStatefulSetCreatePayload)));
  }
}
Severity: Major
Found in app/kubernetes/models/stateful-set/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/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