docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

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

        case 11:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 1:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 7:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 8:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 4:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 5:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 13:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 6:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field CustomPrefix", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 9:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 3:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974
protobuf/plugin/plugin.pb.go on lines 1148..1168

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType)
            }
            var v int
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
protobuf/plugin/plugin.pb.go on lines 702..722
protobuf/plugin/plugin.pb.go on lines 723..743
protobuf/plugin/plugin.pb.go on lines 744..764
protobuf/plugin/plugin.pb.go on lines 765..785
protobuf/plugin/plugin.pb.go on lines 786..806
protobuf/plugin/plugin.pb.go on lines 807..827
protobuf/plugin/plugin.pb.go on lines 828..848
protobuf/plugin/plugin.pb.go on lines 849..869
protobuf/plugin/plugin.pb.go on lines 870..890
protobuf/plugin/plugin.pb.go on lines 891..911
protobuf/plugin/plugin.pb.go on lines 912..932
protobuf/plugin/plugin.pb.go on lines 933..953
protobuf/plugin/plugin.pb.go on lines 954..974

Duplicated Code

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

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

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

Tuning

This issue has a mass of 149.

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

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

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

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

Refactorings

Further Reading

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

func (this *EndpointSpec) String() string {
    if this == nil {
        return "nil"
    }
    repeatedStringForPorts := "[]*PortConfig{"
Severity: Major
Found in api/specs.pb.go and 2 other locations - About 1 hr to fix
api/dispatcher.pb.go on lines 3140..3155
api/dispatcher.pb.go on lines 3176..3191

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

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

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

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

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

Refactorings

Further Reading

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

func (this *UpdateVolumeStatusRequest) String() string {
    if this == nil {
        return "nil"
    }
    repeatedStringForUpdates := "[]*UpdateVolumeStatusRequest_VolumeStatusUpdate{"
Severity: Major
Found in api/dispatcher.pb.go and 2 other locations - About 1 hr to fix
api/dispatcher.pb.go on lines 3140..3155
api/specs.pb.go on lines 4781..4796

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

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

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

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

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

Refactorings

Further Reading

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

func (this *UpdateTaskStatusRequest) String() string {
    if this == nil {
        return "nil"
    }
    repeatedStringForUpdates := "[]*UpdateTaskStatusRequest_TaskStatusUpdate{"
Severity: Major
Found in api/dispatcher.pb.go and 2 other locations - About 1 hr to fix
api/dispatcher.pb.go on lines 3176..3191
api/specs.pb.go on lines 4781..4796

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

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

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

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

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

Refactorings

Further Reading

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

    if storeObject.WatchSelectors.DesiredState != nil && *storeObject.WatchSelectors.DesiredState {
        d.P("case *SelectBy_DesiredState:")
        d.In()
        d.P(`if hasDesiredState {`)
        d.In()
Severity: Major
Found in protobuf/plugin/storeobject/storeobject.go and 2 other locations - About 1 hr to fix
protobuf/plugin/storeobject/storeobject.go on lines 548..560
protobuf/plugin/storeobject/storeobject.go on lines 561..573

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

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

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

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

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

Refactorings

Further Reading

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

    if storeObject.WatchSelectors.Membership != nil && *storeObject.WatchSelectors.Membership {
        d.P("case *SelectBy_Membership:")
        d.In()
        d.P(`if hasMembership {`)
        d.In()
Severity: Major
Found in protobuf/plugin/storeobject/storeobject.go and 2 other locations - About 1 hr to fix
protobuf/plugin/storeobject/storeobject.go on lines 535..547
protobuf/plugin/storeobject/storeobject.go on lines 548..560

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

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

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

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

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

Refactorings

Further Reading

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

    if storeObject.WatchSelectors.Role != nil && *storeObject.WatchSelectors.Role {
        d.P("case *SelectBy_Role:")
        d.In()
        d.P(`if hasRole {`)
        d.In()
Severity: Major
Found in protobuf/plugin/storeobject/storeobject.go and 2 other locations - About 1 hr to fix
protobuf/plugin/storeobject/storeobject.go on lines 535..547
protobuf/plugin/storeobject/storeobject.go on lines 561..573

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

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 printNetworkSummary has 57 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func printNetworkSummary(network *api.Network) {
    w := tabwriter.NewWriter(os.Stdout, 8, 8, 8, ' ', 0)
    defer func() {
        // Ignore flushing errors - there's nothing we can do.
        _ = w.Flush()
Severity: Minor
Found in swarmd/cmd/swarmctl/network/inspect.go - About 1 hr to fix

    Method signHandler.ServeHTTP has 57 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (h *signHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
        if atomic.LoadUint32(h.flaky) == 1 {
            w.WriteHeader(http.StatusInternalServerError)
        }
    
    
    Severity: Minor
    Found in ca/testutils/externalutils.go - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language