docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
            }
            var msglen int
Severity: Major
Found in api/objects.pb.go and 46 other locations - About 2 hrs to fix
api/ca.pb.go on lines 2291..2323
api/logbroker.pb.go on lines 3016..3048
api/objects.pb.go on lines 6328..6360
api/objects.pb.go on lines 6515..6547
api/objects.pb.go on lines 6548..6580
api/objects.pb.go on lines 6617..6649
api/objects.pb.go on lines 6722..6754
api/objects.pb.go on lines 6909..6941
api/objects.pb.go on lines 6942..6974
api/objects.pb.go on lines 7561..7593
api/objects.pb.go on lines 7594..7626
api/objects.pb.go on lines 7710..7742
api/objects.pb.go on lines 7743..7775
api/objects.pb.go on lines 7776..7808
api/objects.pb.go on lines 8433..8465
api/objects.pb.go on lines 8673..8705
api/objects.pb.go on lines 8706..8738
api/objects.pb.go on lines 8739..8771
api/objects.pb.go on lines 9160..9192
api/objects.pb.go on lines 9193..9225
api/objects.pb.go on lines 9328..9360
api/objects.pb.go on lines 9361..9393
api/objects.pb.go on lines 9476..9508
api/objects.pb.go on lines 9509..9541
api/objects.pb.go on lines 9692..9724
api/objects.pb.go on lines 9725..9757
api/objects.pb.go on lines 9872..9904
api/objects.pb.go on lines 9905..9937
api/raft.pb.go on lines 3100..3132
api/snapshot.pb.go on lines 1441..1473
api/snapshot.pb.go on lines 1474..1506
api/specs.pb.go on lines 4925..4957
api/specs.pb.go on lines 5065..5097
api/specs.pb.go on lines 5098..5130
api/specs.pb.go on lines 8015..8047
api/specs.pb.go on lines 8282..8314
api/specs.pb.go on lines 8315..8347
api/specs.pb.go on lines 8348..8380
api/specs.pb.go on lines 8381..8413
api/specs.pb.go on lines 8414..8446
api/specs.pb.go on lines 8447..8479
api/specs.pb.go on lines 8480..8512
api/specs.pb.go on lines 8513..8545
api/specs.pb.go on lines 8596..8628
api/specs.pb.go on lines 8785..8817
api/specs.pb.go on lines 8938..8970

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

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

        case 4:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Raft", wireType)
            }
            var msglen int
Severity: Major
Found in api/specs.pb.go and 46 other locations - About 2 hrs to fix
api/ca.pb.go on lines 2291..2323
api/logbroker.pb.go on lines 3016..3048
api/objects.pb.go on lines 6328..6360
api/objects.pb.go on lines 6515..6547
api/objects.pb.go on lines 6548..6580
api/objects.pb.go on lines 6617..6649
api/objects.pb.go on lines 6722..6754
api/objects.pb.go on lines 6909..6941
api/objects.pb.go on lines 6942..6974
api/objects.pb.go on lines 7561..7593
api/objects.pb.go on lines 7594..7626
api/objects.pb.go on lines 7710..7742
api/objects.pb.go on lines 7743..7775
api/objects.pb.go on lines 7776..7808
api/objects.pb.go on lines 8433..8465
api/objects.pb.go on lines 8466..8498
api/objects.pb.go on lines 8673..8705
api/objects.pb.go on lines 8706..8738
api/objects.pb.go on lines 8739..8771
api/objects.pb.go on lines 9160..9192
api/objects.pb.go on lines 9193..9225
api/objects.pb.go on lines 9328..9360
api/objects.pb.go on lines 9361..9393
api/objects.pb.go on lines 9476..9508
api/objects.pb.go on lines 9509..9541
api/objects.pb.go on lines 9692..9724
api/objects.pb.go on lines 9725..9757
api/objects.pb.go on lines 9872..9904
api/objects.pb.go on lines 9905..9937
api/raft.pb.go on lines 3100..3132
api/snapshot.pb.go on lines 1441..1473
api/snapshot.pb.go on lines 1474..1506
api/specs.pb.go on lines 4925..4957
api/specs.pb.go on lines 5065..5097
api/specs.pb.go on lines 5098..5130
api/specs.pb.go on lines 8015..8047
api/specs.pb.go on lines 8282..8314
api/specs.pb.go on lines 8315..8347
api/specs.pb.go on lines 8348..8380
api/specs.pb.go on lines 8414..8446
api/specs.pb.go on lines 8447..8479
api/specs.pb.go on lines 8480..8512
api/specs.pb.go on lines 8513..8545
api/specs.pb.go on lines 8596..8628
api/specs.pb.go on lines 8785..8817
api/specs.pb.go on lines 8938..8970

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

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

        case 2:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
            }
            var msglen int
Severity: Major
Found in api/objects.pb.go and 46 other locations - About 2 hrs to fix
api/ca.pb.go on lines 2291..2323
api/logbroker.pb.go on lines 3016..3048
api/objects.pb.go on lines 6328..6360
api/objects.pb.go on lines 6515..6547
api/objects.pb.go on lines 6548..6580
api/objects.pb.go on lines 6617..6649
api/objects.pb.go on lines 6722..6754
api/objects.pb.go on lines 6909..6941
api/objects.pb.go on lines 6942..6974
api/objects.pb.go on lines 7561..7593
api/objects.pb.go on lines 7594..7626
api/objects.pb.go on lines 7710..7742
api/objects.pb.go on lines 7743..7775
api/objects.pb.go on lines 7776..7808
api/objects.pb.go on lines 8466..8498
api/objects.pb.go on lines 8673..8705
api/objects.pb.go on lines 8706..8738
api/objects.pb.go on lines 8739..8771
api/objects.pb.go on lines 9160..9192
api/objects.pb.go on lines 9193..9225
api/objects.pb.go on lines 9328..9360
api/objects.pb.go on lines 9361..9393
api/objects.pb.go on lines 9476..9508
api/objects.pb.go on lines 9509..9541
api/objects.pb.go on lines 9692..9724
api/objects.pb.go on lines 9725..9757
api/objects.pb.go on lines 9872..9904
api/objects.pb.go on lines 9905..9937
api/raft.pb.go on lines 3100..3132
api/snapshot.pb.go on lines 1441..1473
api/snapshot.pb.go on lines 1474..1506
api/specs.pb.go on lines 4925..4957
api/specs.pb.go on lines 5065..5097
api/specs.pb.go on lines 5098..5130
api/specs.pb.go on lines 8015..8047
api/specs.pb.go on lines 8282..8314
api/specs.pb.go on lines 8315..8347
api/specs.pb.go on lines 8348..8380
api/specs.pb.go on lines 8381..8413
api/specs.pb.go on lines 8414..8446
api/specs.pb.go on lines 8447..8479
api/specs.pb.go on lines 8480..8512
api/specs.pb.go on lines 8513..8545
api/specs.pb.go on lines 8596..8628
api/specs.pb.go on lines 8785..8817
api/specs.pb.go on lines 8938..8970

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

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

        case 2:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType)
            }
            var msglen int
Severity: Major
Found in api/objects.pb.go and 46 other locations - About 2 hrs to fix
api/ca.pb.go on lines 2291..2323
api/logbroker.pb.go on lines 3016..3048
api/objects.pb.go on lines 6328..6360
api/objects.pb.go on lines 6515..6547
api/objects.pb.go on lines 6548..6580
api/objects.pb.go on lines 6617..6649
api/objects.pb.go on lines 6722..6754
api/objects.pb.go on lines 6909..6941
api/objects.pb.go on lines 6942..6974
api/objects.pb.go on lines 7561..7593
api/objects.pb.go on lines 7594..7626
api/objects.pb.go on lines 7710..7742
api/objects.pb.go on lines 7743..7775
api/objects.pb.go on lines 7776..7808
api/objects.pb.go on lines 8433..8465
api/objects.pb.go on lines 8466..8498
api/objects.pb.go on lines 8706..8738
api/objects.pb.go on lines 8739..8771
api/objects.pb.go on lines 9160..9192
api/objects.pb.go on lines 9193..9225
api/objects.pb.go on lines 9328..9360
api/objects.pb.go on lines 9361..9393
api/objects.pb.go on lines 9476..9508
api/objects.pb.go on lines 9509..9541
api/objects.pb.go on lines 9692..9724
api/objects.pb.go on lines 9725..9757
api/objects.pb.go on lines 9872..9904
api/objects.pb.go on lines 9905..9937
api/raft.pb.go on lines 3100..3132
api/snapshot.pb.go on lines 1441..1473
api/snapshot.pb.go on lines 1474..1506
api/specs.pb.go on lines 4925..4957
api/specs.pb.go on lines 5065..5097
api/specs.pb.go on lines 5098..5130
api/specs.pb.go on lines 8015..8047
api/specs.pb.go on lines 8282..8314
api/specs.pb.go on lines 8315..8347
api/specs.pb.go on lines 8348..8380
api/specs.pb.go on lines 8381..8413
api/specs.pb.go on lines 8414..8446
api/specs.pb.go on lines 8447..8479
api/specs.pb.go on lines 8480..8512
api/specs.pb.go on lines 8513..8545
api/specs.pb.go on lines 8596..8628
api/specs.pb.go on lines 8785..8817
api/specs.pb.go on lines 8938..8970

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
            }
            var msglen int
Severity: Major
Found in api/objects.pb.go and 46 other locations - About 2 hrs to fix
api/ca.pb.go on lines 2291..2323
api/logbroker.pb.go on lines 3016..3048
api/objects.pb.go on lines 6328..6360
api/objects.pb.go on lines 6515..6547
api/objects.pb.go on lines 6548..6580
api/objects.pb.go on lines 6617..6649
api/objects.pb.go on lines 6722..6754
api/objects.pb.go on lines 6909..6941
api/objects.pb.go on lines 6942..6974
api/objects.pb.go on lines 7561..7593
api/objects.pb.go on lines 7594..7626
api/objects.pb.go on lines 7710..7742
api/objects.pb.go on lines 7743..7775
api/objects.pb.go on lines 7776..7808
api/objects.pb.go on lines 8433..8465
api/objects.pb.go on lines 8466..8498
api/objects.pb.go on lines 8673..8705
api/objects.pb.go on lines 8706..8738
api/objects.pb.go on lines 8739..8771
api/objects.pb.go on lines 9160..9192
api/objects.pb.go on lines 9193..9225
api/objects.pb.go on lines 9328..9360
api/objects.pb.go on lines 9361..9393
api/objects.pb.go on lines 9476..9508
api/objects.pb.go on lines 9692..9724
api/objects.pb.go on lines 9725..9757
api/objects.pb.go on lines 9872..9904
api/objects.pb.go on lines 9905..9937
api/raft.pb.go on lines 3100..3132
api/snapshot.pb.go on lines 1441..1473
api/snapshot.pb.go on lines 1474..1506
api/specs.pb.go on lines 4925..4957
api/specs.pb.go on lines 5065..5097
api/specs.pb.go on lines 5098..5130
api/specs.pb.go on lines 8015..8047
api/specs.pb.go on lines 8282..8314
api/specs.pb.go on lines 8315..8347
api/specs.pb.go on lines 8348..8380
api/specs.pb.go on lines 8381..8413
api/specs.pb.go on lines 8414..8446
api/specs.pb.go on lines 8447..8479
api/specs.pb.go on lines 8480..8512
api/specs.pb.go on lines 8513..8545
api/specs.pb.go on lines 8596..8628
api/specs.pb.go on lines 8785..8817
api/specs.pb.go on lines 8938..8970

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

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 (s *Server) RemoveService(ctx context.Context, request *api.RemoveServiceRequest) (*api.RemoveServiceResponse, error) {
    if request.ServiceID == "" {
        return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
    }

Severity: Major
Found in manager/controlapi/service.go and 1 other location - About 2 hrs to fix
manager/controlapi/task.go on lines 38..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 218.

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 (s *Server) RemoveTask(ctx context.Context, request *api.RemoveTaskRequest) (*api.RemoveTaskResponse, error) {
    if request.TaskID == "" {
        return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
    }

Severity: Major
Found in manager/controlapi/task.go and 1 other location - About 2 hrs to fix
manager/controlapi/service.go on lines 943..958

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

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

        case 16:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field ReferencedConfigID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206

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

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

        case 4:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 7:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 2:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 13:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field ReferencedNetworkID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 8:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 15:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4207..4238

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

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

        case 8:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/specs.pb.go and 10 other locations - About 2 hrs to fix
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4143..4174
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

        case 14:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field ReferencedSecretID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/watch.pb.go and 10 other locations - About 2 hrs to fix
api/specs.pb.go on lines 8200..8231
api/watch.pb.go on lines 3754..3785
api/watch.pb.go on lines 3786..3817
api/watch.pb.go on lines 3818..3849
api/watch.pb.go on lines 3850..3881
api/watch.pb.go on lines 3952..3983
api/watch.pb.go on lines 3984..4015
api/watch.pb.go on lines 4111..4142
api/watch.pb.go on lines 4175..4206
api/watch.pb.go on lines 4207..4238

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

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

    hasNoIPOverlapTasks := func(fakeT assert.TestingT, s *store.MemoryStore, task *api.Task) bool {
        assert.NotEqual(fakeT, len(task.Networks), 0)
        assert.NotEqual(fakeT, len(task.Networks[0].Addresses), 0)
        assignedIP := task.Networks[0].Addresses[0]
        if assignedIPs[assignedIP] {
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 1 other location - About 2 hrs to fix
manager/allocator/allocator_test_suite.go on lines 1179..1192

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

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

    hasNoIPOverlapTasks := func(fakeT assert.TestingT, s *store.MemoryStore, task *api.Task) bool {
        assert.NotEqual(fakeT, len(task.Networks), 0)
        assert.NotEqual(fakeT, len(task.Networks[0].Addresses), 0)
        assignedIP := task.Networks[1].Addresses[0]
        if assignedIPs[assignedIP] {
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 1 other location - About 2 hrs to fix
manager/allocator/allocator_test_suite.go on lines 981..994

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

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