k8up-io/k8up

View on GitHub

Showing 76 of 82 total issues

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

func (in *CheckSchedule) DeepCopyInto(out *CheckSchedule) {
    *out = *in
    in.CheckSpec.DeepCopyInto(&out.CheckSpec)
    if in.ScheduleCommon != nil {
        in, out := &in.ScheduleCommon, &out.ScheduleCommon
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 50 mins to fix
api/v1/zz_generated.deepcopy.go on lines 73..81
api/v1/zz_generated.deepcopy.go on lines 301..309
api/v1/zz_generated.deepcopy.go on lines 738..746
api/v1/zz_generated.deepcopy.go on lines 916..924

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

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 *ArchiveSchedule) DeepCopyInto(out *ArchiveSchedule) {
    *out = *in
    in.ArchiveSpec.DeepCopyInto(&out.ArchiveSpec)
    if in.ScheduleCommon != nil {
        in, out := &in.ScheduleCommon, &out.ScheduleCommon
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 50 mins to fix
api/v1/zz_generated.deepcopy.go on lines 301..309
api/v1/zz_generated.deepcopy.go on lines 443..451
api/v1/zz_generated.deepcopy.go on lines 738..746
api/v1/zz_generated.deepcopy.go on lines 916..924

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

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 *PruneSchedule) DeepCopyInto(out *PruneSchedule) {
    *out = *in
    in.PruneSpec.DeepCopyInto(&out.PruneSpec)
    if in.ScheduleCommon != nil {
        in, out := &in.ScheduleCommon, &out.ScheduleCommon
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 50 mins to fix
api/v1/zz_generated.deepcopy.go on lines 73..81
api/v1/zz_generated.deepcopy.go on lines 301..309
api/v1/zz_generated.deepcopy.go on lines 443..451
api/v1/zz_generated.deepcopy.go on lines 916..924

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

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 *RestoreSchedule) DeepCopyInto(out *RestoreSchedule) {
    *out = *in
    in.RestoreSpec.DeepCopyInto(&out.RestoreSpec)
    if in.ScheduleCommon != nil {
        in, out := &in.ScheduleCommon, &out.ScheduleCommon
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 50 mins to fix
api/v1/zz_generated.deepcopy.go on lines 73..81
api/v1/zz_generated.deepcopy.go on lines 301..309
api/v1/zz_generated.deepcopy.go on lines 443..451
api/v1/zz_generated.deepcopy.go on lines 738..746

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

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 *BackupSchedule) DeepCopyInto(out *BackupSchedule) {
    *out = *in
    in.BackupSpec.DeepCopyInto(&out.BackupSpec)
    if in.ScheduleCommon != nil {
        in, out := &in.ScheduleCommon, &out.ScheduleCommon
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 4 other locations - About 50 mins to fix
api/v1/zz_generated.deepcopy.go on lines 73..81
api/v1/zz_generated.deepcopy.go on lines 443..451
api/v1/zz_generated.deepcopy.go on lines 738..746
api/v1/zz_generated.deepcopy.go on lines 916..924

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

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

func (in *Backup) DeepCopyInto(out *Backup) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
    in.Spec.DeepCopyInto(&out.Spec)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 5 other locations - About 45 mins to fix
api/v1/zz_generated.deepcopy.go on lines 14..20
api/v1/zz_generated.deepcopy.go on lines 384..390
api/v1/zz_generated.deepcopy.go on lines 679..685
api/v1/zz_generated.deepcopy.go on lines 816..822
api/v1/zz_generated.deepcopy.go on lines 1105..1111

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

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

func (in *Schedule) DeepCopyInto(out *Schedule) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
    in.Spec.DeepCopyInto(&out.Spec)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 5 other locations - About 45 mins to fix
api/v1/zz_generated.deepcopy.go on lines 14..20
api/v1/zz_generated.deepcopy.go on lines 242..248
api/v1/zz_generated.deepcopy.go on lines 384..390
api/v1/zz_generated.deepcopy.go on lines 679..685
api/v1/zz_generated.deepcopy.go on lines 816..822

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

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

func (in *Prune) DeepCopyInto(out *Prune) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
    in.Spec.DeepCopyInto(&out.Spec)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 5 other locations - About 45 mins to fix
api/v1/zz_generated.deepcopy.go on lines 14..20
api/v1/zz_generated.deepcopy.go on lines 242..248
api/v1/zz_generated.deepcopy.go on lines 384..390
api/v1/zz_generated.deepcopy.go on lines 816..822
api/v1/zz_generated.deepcopy.go on lines 1105..1111

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

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

func (in *Archive) DeepCopyInto(out *Archive) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
    in.Spec.DeepCopyInto(&out.Spec)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 5 other locations - About 45 mins to fix
api/v1/zz_generated.deepcopy.go on lines 242..248
api/v1/zz_generated.deepcopy.go on lines 384..390
api/v1/zz_generated.deepcopy.go on lines 679..685
api/v1/zz_generated.deepcopy.go on lines 816..822
api/v1/zz_generated.deepcopy.go on lines 1105..1111

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

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

func (in *Check) DeepCopyInto(out *Check) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
    in.Spec.DeepCopyInto(&out.Spec)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 5 other locations - About 45 mins to fix
api/v1/zz_generated.deepcopy.go on lines 14..20
api/v1/zz_generated.deepcopy.go on lines 242..248
api/v1/zz_generated.deepcopy.go on lines 679..685
api/v1/zz_generated.deepcopy.go on lines 816..822
api/v1/zz_generated.deepcopy.go on lines 1105..1111

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

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

func (in *Restore) DeepCopyInto(out *Restore) {
    *out = *in
    out.TypeMeta = in.TypeMeta
    in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
    in.Spec.DeepCopyInto(&out.Spec)
Severity: Major
Found in api/v1/zz_generated.deepcopy.go and 5 other locations - About 45 mins to fix
api/v1/zz_generated.deepcopy.go on lines 14..20
api/v1/zz_generated.deepcopy.go on lines 242..248
api/v1/zz_generated.deepcopy.go on lines 384..390
api/v1/zz_generated.deepcopy.go on lines 679..685
api/v1/zz_generated.deepcopy.go on lines 1105..1111

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

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

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

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

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

Refactorings

Further Reading

Function NewPodLister has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

func NewPodLister(ctx context.Context, k8cli client.Client, backupCommandAnnotation, fileExtensionAnnotation, backupContainerAnnotation, namespace string, targetPods []string, skipPreBackup bool, log logr.Logger) *PodLister {
Severity: Minor
Found in restic/kubernetes/pod_list.go - About 45 mins to fix

    Method ScheduleHandler.createJobList has 7 return statements (exceeds 4 allowed).
    Open

    func (s *ScheduleHandler) createJobList(ctx context.Context) error {
        type objectInstantiator struct {
            spec k8upv1.ScheduleSpecInterface
            ctor func(spec k8upv1.ScheduleSpecInterface) k8upv1.JobObject
        }
    Severity: Major
    Found in operator/schedulecontroller/handler.go - About 45 mins to fix

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

      func (ts *Suite) EnsureResources(resources ...client.Object) {
          for _, resource := range resources {
              ts.T().Logf("creating resource '%s/%s'", resource.GetNamespace(), resource.GetName())
              ts.Require().NoError(ts.Client.Create(ts.Ctx, resource))
          }
      Severity: Major
      Found in envtest/envsuite.go and 2 other locations - About 40 mins to fix
      envtest/envsuite.go on lines 143..148
      envtest/envsuite.go on lines 177..182

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

      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 (ts *Suite) DeleteResources(resources ...client.Object) {
          for _, resource := range resources {
              ts.T().Logf("deleting '%s/%s'", resource.GetNamespace(), resource.GetName())
              ts.Require().NoError(ts.Client.Delete(ts.Ctx, resource))
          }
      Severity: Major
      Found in envtest/envsuite.go and 2 other locations - About 40 mins to fix
      envtest/envsuite.go on lines 135..140
      envtest/envsuite.go on lines 143..148

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

      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 (ts *Suite) UpdateResources(resources ...client.Object) {
          for _, resource := range resources {
              ts.T().Logf("updating resource '%s/%s'", resource.GetNamespace(), resource.GetName())
              ts.Require().NoError(ts.Client.Update(ts.Ctx, resource))
          }
      Severity: Major
      Found in envtest/envsuite.go and 2 other locations - About 40 mins to fix
      envtest/envsuite.go on lines 135..140
      envtest/envsuite.go on lines 177..182

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

      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 b.backup != nil {
              if b.backup.Spec.Backend != nil {
                  for key, value := range b.backup.Spec.Backend.GetCredentialEnv() {
                      vars.SetEnvVarSource(key, value)
                  }
      Severity: Minor
      Found in operator/backupcontroller/backup_utils.go and 1 other location - About 40 mins to fix
      operator/checkcontroller/executor.go on lines 89..96

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 110.

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

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

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

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

      Refactorings

      Further Reading

      Function generatePemFile has 6 return statements (exceeds 4 allowed).
      Open

      func generatePemFile(clientCert string, clientKey string, dest string) error {
          certIn, err := os.Open(clientCert)
          if err != nil {
              return err
          }
      Severity: Major
      Found in restic/cli/utils.go - About 40 mins to fix

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

            if c.check != nil {
                if c.check.Spec.Backend != nil {
                    for key, value := range c.check.Spec.Backend.GetCredentialEnv() {
                        vars.SetEnvVarSource(key, value)
                    }
        Severity: Minor
        Found in operator/checkcontroller/executor.go and 1 other location - About 40 mins to fix
        operator/backupcontroller/backup_utils.go on lines 92..99

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

        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

        Method Config.SetConditionUnknownWithMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (c *Config) SetConditionUnknownWithMessage(ctx context.Context, condition k8upv1.ConditionType, reason k8upv1.ConditionReason, message string, args ...interface{}) {
        Severity: Minor
        Found in operator/job/status.go - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language