docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

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 Task", 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 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 Store", wireType)
            }
            var msglen int
Severity: Major
Found in api/snapshot.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/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 RootCA", 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 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 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Annotations", 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 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 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 Membership", wireType)
            }
            var msglen int
Severity: Major
Found in api/snapshot.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 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 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 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 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 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 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 Version", wireType)
            }
            var msglen int
Severity: Major
Found in api/ca.pb.go and 46 other locations - About 2 hrs to fix
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 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 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 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 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 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 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 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 8:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Certificate", 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 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 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 Orchestration", 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 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 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 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 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 6:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field CAConfig", 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 8381..8413
api/specs.pb.go on lines 8414..8446
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 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

Function parseResource has 87 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func parseResource(flags *pflag.FlagSet, spec *api.ServiceSpec) error {
    if flags.Changed("memory-reservation") {
        if spec.Task.Resources == nil {
            spec.Task.Resources = &api.ResourceRequirements{}
        }
Severity: Major
Found in swarmd/cmd/swarmctl/service/flagparser/resource.go - About 2 hrs to fix

    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

    Function printNodeSummary has 86 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func printNodeSummary(node *api.Node) {
        w := tabwriter.NewWriter(os.Stdout, 8, 8, 8, ' ', 0)
        defer func() {
            // Ignore flushing errors - there's nothing we can do.
            _ = w.Flush()
    Severity: Major
    Found in swarmd/cmd/swarmctl/node/inspect.go - About 2 hrs to fix

      Function NodeMatches has 86 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func NodeMatches(constraints []Constraint, n *api.Node) bool {
          for _, constraint := range constraints {
              switch {
              case strings.EqualFold(constraint.key, "node.id"):
                  if !constraint.Match(n.ID) {
      Severity: Major
      Found in manager/constraint/constraint.go - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language