Showing 48 of 82 total issues

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

package prunecontroller

import (
    "context"
    "time"
Severity: Major
Found in operator/prunecontroller/controller.go and 1 other location - About 1 day to fix
operator/checkcontroller/controller.go on lines 1..69

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 614.

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

package checkcontroller

import (
    "context"
    "time"
Severity: Major
Found in operator/checkcontroller/controller.go and 1 other location - About 1 day to fix
operator/prunecontroller/controller.go on lines 1..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 614.

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

func (in *RestServerSpec) DeepCopyInto(out *RestServerSpec) {
    *out = *in
    if in.UserSecretRef != nil {
        in, out := &in.UserSecretRef, &out.UserSecretRef
        *out = new(corev1.SecretKeySelector)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 114..126
api/v1/zz_generated.deepcopy.go on lines 139..151
api/v1/zz_generated.deepcopy.go on lines 545..557
api/v1/zz_generated.deepcopy.go on lines 1080..1092

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

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

func (in *S3Spec) DeepCopyInto(out *S3Spec) {
    *out = *in
    if in.AccessKeyIDSecretRef != nil {
        in, out := &in.AccessKeyIDSecretRef, &out.AccessKeyIDSecretRef
        *out = new(corev1.SecretKeySelector)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 114..126
api/v1/zz_generated.deepcopy.go on lines 139..151
api/v1/zz_generated.deepcopy.go on lines 545..557
api/v1/zz_generated.deepcopy.go on lines 791..803

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

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

func (in *AzureSpec) DeepCopyInto(out *AzureSpec) {
    *out = *in
    if in.AccountNameSecretRef != nil {
        in, out := &in.AccountNameSecretRef, &out.AccountNameSecretRef
        *out = new(corev1.SecretKeySelector)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 139..151
api/v1/zz_generated.deepcopy.go on lines 545..557
api/v1/zz_generated.deepcopy.go on lines 791..803
api/v1/zz_generated.deepcopy.go on lines 1080..1092

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

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

func (in *B2Spec) DeepCopyInto(out *B2Spec) {
    *out = *in
    if in.AccountIDSecretRef != nil {
        in, out := &in.AccountIDSecretRef, &out.AccountIDSecretRef
        *out = new(corev1.SecretKeySelector)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 114..126
api/v1/zz_generated.deepcopy.go on lines 545..557
api/v1/zz_generated.deepcopy.go on lines 791..803
api/v1/zz_generated.deepcopy.go on lines 1080..1092

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

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

func (in *GCSSpec) DeepCopyInto(out *GCSSpec) {
    *out = *in
    if in.ProjectIDSecretRef != nil {
        in, out := &in.ProjectIDSecretRef, &out.ProjectIDSecretRef
        *out = new(corev1.SecretKeySelector)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 114..126
api/v1/zz_generated.deepcopy.go on lines 139..151
api/v1/zz_generated.deepcopy.go on lines 791..803
api/v1/zz_generated.deepcopy.go on lines 1080..1092

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *ScheduleList) DeepCopyInto(out *ScheduleList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *BackupList) DeepCopyInto(out *BackupList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1147..1158
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *PruneList) DeepCopyInto(out *PruneList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1147..1158
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *ArchiveList) DeepCopyInto(out *ArchiveList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1147..1158
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *RestoreList) DeepCopyInto(out *RestoreList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 1147..1158
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *CheckList) DeepCopyInto(out *CheckList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1147..1158
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *PreBackupPodList) DeepCopyInto(out *PreBackupPodList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1147..1158
api/v1/zz_generated.deepcopy.go on lines 1299..1310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (in *SnapshotList) DeepCopyInto(out *SnapshotList) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ListMeta.DeepCopyInto(&out.ListMeta)
    if in.Items != nil {
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 7 other locations - About 1 hr to fix
api/v1/zz_generated.deepcopy.go on lines 41..52
api/v1/zz_generated.deepcopy.go on lines 269..280
api/v1/zz_generated.deepcopy.go on lines 411..422
api/v1/zz_generated.deepcopy.go on lines 627..638
api/v1/zz_generated.deepcopy.go on lines 706..717
api/v1/zz_generated.deepcopy.go on lines 843..854
api/v1/zz_generated.deepcopy.go on lines 1147..1158

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (c *CheckExecutor) attachTLSVolumeMounts() []corev1.VolumeMount {
    var tlsVolumeMounts []corev1.VolumeMount
    if c.check.Spec.Backend != nil && !utils.ZeroLen(c.check.Spec.Backend.VolumeMounts) {
        tlsVolumeMounts = append(tlsVolumeMounts, *c.check.Spec.Backend.VolumeMounts...)
    }
Severity: Major
Found in operator/checkcontroller/executor.go and 2 other locations - About 1 hr to fix
operator/prunecontroller/executor.go on lines 144..151
operator/backupcontroller/executor.go on lines 307..314

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (b *BackupExecutor) attachTLSVolumeMounts() []corev1.VolumeMount {
    var tlsVolumeMounts []corev1.VolumeMount
    if b.backup.Spec.Backend != nil && !utils.ZeroLen(b.backup.Spec.Backend.VolumeMounts) {
        tlsVolumeMounts = append(tlsVolumeMounts, *b.backup.Spec.Backend.VolumeMounts...)
    }
Severity: Major
Found in operator/backupcontroller/executor.go and 2 other locations - About 1 hr to fix
operator/prunecontroller/executor.go on lines 144..151
operator/checkcontroller/executor.go on lines 112..119

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (p *PruneExecutor) attachTLSVolumeMounts() []corev1.VolumeMount {
    var tlsVolumeMounts []corev1.VolumeMount
    if p.prune.Spec.Backend != nil && !utils.ZeroLen(p.prune.Spec.Backend.VolumeMounts) {
        tlsVolumeMounts = append(tlsVolumeMounts, *p.prune.Spec.Backend.VolumeMounts...)
    }
Severity: Major
Found in operator/prunecontroller/executor.go and 2 other locations - About 1 hr to fix
operator/backupcontroller/executor.go on lines 307..314
operator/checkcontroller/executor.go on lines 112..119

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

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

                    S3: &v1.S3Spec{
                        Endpoint: restore.Cfg.S3Endpoint,
                        Bucket:   restore.Cfg.S3Bucket,
                        AccessKeyIDSecretRef: &corev1.SecretKeySelector{
                            Key: restore.Cfg.S3SecretRefUsernameKey,
Severity: Major
Found in cmd/cli/main.go and 1 other location - About 1 hr to fix
cmd/cli/main.go on lines 279..294

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

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

        S3: &v1.S3Spec{
            Endpoint: restore.Cfg.RestoreToS3Endpoint,
            Bucket:   restore.Cfg.RestoreToS3Bucket,
            AccessKeyIDSecretRef: &corev1.SecretKeySelector{
                Key: restore.Cfg.RestoreToS3SecretUsernameKey,
Severity: Major
Found in cmd/cli/main.go and 1 other location - About 1 hr to fix
cmd/cli/main.go on lines 324..339

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

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