docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

func encodeVarintSpecs(dAtA []byte, offset int, v uint64) int {
    offset -= sovSpecs(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/specs.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
api/dispatcher.pb.go on lines 2431..2441
api/health.pb.go on lines 360..370
api/logbroker.pb.go on lines 1704..1714
api/objects.pb.go on lines 2619..2629
api/raft.pb.go on lines 2074..2084
api/resource.pb.go on lines 552..562
api/snapshot.pb.go on lines 616..626
api/watch.pb.go on lines 2137..2147
protobuf/plugin/plugin.pb.go on lines 526..536

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

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

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

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

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

Refactorings

Further Reading

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

func (this *LogAttr) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&LogAttr{`,
Severity: Major
Found in api/logbroker.pb.go and 7 other locations - About 35 mins to fix
api/ca.pb.go on lines 1527..1537
api/dispatcher.pb.go on lines 3192..3202
api/objects.pb.go on lines 6088..6098
api/raft.pb.go on lines 2869..2879
api/specs.pb.go on lines 4544..4554
api/specs.pb.go on lines 4621..4631
api/watch.pb.go on lines 2815..2825

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

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

func (c *cAClient) GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error) {
    out := new(GetRootCACertificateResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetRootCACertificate", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/dispatcher.pb.go on lines 1434..1441
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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

func (c *dispatcherClient) UpdateTaskStatus(ctx context.Context, in *UpdateTaskStatusRequest, opts ...grpc.CallOption) (*UpdateTaskStatusResponse, error) {
    out := new(UpdateTaskStatusResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateTaskStatus", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1434..1441
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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

func (c *raftMembershipClient) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error) {
    out := new(LeaveResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Leave", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/dispatcher.pb.go on lines 1434..1441
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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

func encodeVarintResource(dAtA []byte, offset int, v uint64) int {
    offset -= sovResource(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/resource.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
api/dispatcher.pb.go on lines 2431..2441
api/health.pb.go on lines 360..370
api/logbroker.pb.go on lines 1704..1714
api/objects.pb.go on lines 2619..2629
api/raft.pb.go on lines 2074..2084
api/snapshot.pb.go on lines 616..626
api/specs.pb.go on lines 3784..3794
api/watch.pb.go on lines 2137..2147
protobuf/plugin/plugin.pb.go on lines 526..536

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

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

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

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

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

Refactorings

Further Reading

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

func (this *IssueNodeCertificateResponse) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&IssueNodeCertificateResponse{`,
Severity: Major
Found in api/ca.pb.go and 7 other locations - About 35 mins to fix
api/dispatcher.pb.go on lines 3192..3202
api/logbroker.pb.go on lines 2275..2285
api/objects.pb.go on lines 6088..6098
api/raft.pb.go on lines 2869..2879
api/specs.pb.go on lines 4544..4554
api/specs.pb.go on lines 4621..4631
api/watch.pb.go on lines 2815..2825

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

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

func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
    out := new(HealthCheckResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Health/Check", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/health.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/dispatcher.pb.go on lines 1434..1441
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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

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

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

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

Refactorings

Further Reading

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

func (this *ReplicatedJob) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&ReplicatedJob{`,
Severity: Major
Found in api/specs.pb.go and 7 other locations - About 35 mins to fix
api/ca.pb.go on lines 1527..1537
api/dispatcher.pb.go on lines 3192..3202
api/logbroker.pb.go on lines 2275..2285
api/objects.pb.go on lines 6088..6098
api/raft.pb.go on lines 2869..2879
api/specs.pb.go on lines 4621..4631
api/watch.pb.go on lines 2815..2825

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

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

func encodeVarintRaft(dAtA []byte, offset int, v uint64) int {
    offset -= sovRaft(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/raft.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
api/dispatcher.pb.go on lines 2431..2441
api/health.pb.go on lines 360..370
api/logbroker.pb.go on lines 1704..1714
api/objects.pb.go on lines 2619..2629
api/resource.pb.go on lines 552..562
api/snapshot.pb.go on lines 616..626
api/specs.pb.go on lines 3784..3794
api/watch.pb.go on lines 2137..2147
protobuf/plugin/plugin.pb.go on lines 526..536

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

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

func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int {
    offset -= sovPlugin(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in protobuf/plugin/plugin.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
api/dispatcher.pb.go on lines 2431..2441
api/health.pb.go on lines 360..370
api/logbroker.pb.go on lines 1704..1714
api/objects.pb.go on lines 2619..2629
api/raft.pb.go on lines 2074..2084
api/resource.pb.go on lines 552..562
api/snapshot.pb.go on lines 616..626
api/specs.pb.go on lines 3784..3794
api/watch.pb.go on lines 2137..2147

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

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

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

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

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

Refactorings

Further Reading

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

func (this *UpdateVolumeStatusRequest_VolumeStatusUpdate) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&UpdateVolumeStatusRequest_VolumeStatusUpdate{`,
Severity: Major
Found in api/dispatcher.pb.go and 7 other locations - About 35 mins to fix
api/ca.pb.go on lines 1527..1537
api/logbroker.pb.go on lines 2275..2285
api/objects.pb.go on lines 6088..6098
api/raft.pb.go on lines 2869..2879
api/specs.pb.go on lines 4544..4554
api/specs.pb.go on lines 4621..4631
api/watch.pb.go on lines 2815..2825

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

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

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

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

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

Refactorings

Further Reading

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

func (this *Endpoint_VirtualIP) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&Endpoint_VirtualIP{`,
Severity: Major
Found in api/objects.pb.go and 7 other locations - About 35 mins to fix
api/ca.pb.go on lines 1527..1537
api/dispatcher.pb.go on lines 3192..3202
api/logbroker.pb.go on lines 2275..2285
api/raft.pb.go on lines 2869..2879
api/specs.pb.go on lines 4544..4554
api/specs.pb.go on lines 4621..4631
api/watch.pb.go on lines 2815..2825

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

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

func encodeVarintLogbroker(dAtA []byte, offset int, v uint64) int {
    offset -= sovLogbroker(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/logbroker.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
api/dispatcher.pb.go on lines 2431..2441
api/health.pb.go on lines 360..370
api/objects.pb.go on lines 2619..2629
api/raft.pb.go on lines 2074..2084
api/resource.pb.go on lines 552..562
api/snapshot.pb.go on lines 616..626
api/specs.pb.go on lines 3784..3794
api/watch.pb.go on lines 2137..2147
protobuf/plugin/plugin.pb.go on lines 526..536

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

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

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

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

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

Refactorings

Further Reading

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

func (this *ResourceReference) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&ResourceReference{`,
Severity: Major
Found in api/specs.pb.go and 7 other locations - About 35 mins to fix
api/ca.pb.go on lines 1527..1537
api/dispatcher.pb.go on lines 3192..3202
api/logbroker.pb.go on lines 2275..2285
api/objects.pb.go on lines 6088..6098
api/raft.pb.go on lines 2869..2879
api/specs.pb.go on lines 4544..4554
api/watch.pb.go on lines 2815..2825

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

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

func (c *dispatcherClient) UpdateVolumeStatus(ctx context.Context, in *UpdateVolumeStatusRequest, opts ...grpc.CallOption) (*UpdateVolumeStatusResponse, error) {
    out := new(UpdateVolumeStatusResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateVolumeStatus", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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

func (c *cAClient) GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error) {
    out := new(GetUnlockKeyResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetUnlockKey", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/dispatcher.pb.go on lines 1434..1441
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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

func (c *resourceAllocatorClient) AttachNetwork(ctx context.Context, in *AttachNetworkRequest, opts ...grpc.CallOption) (*AttachNetworkResponse, error) {
    out := new(AttachNetworkResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.ResourceAllocator/AttachNetwork", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/resource.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/dispatcher.pb.go on lines 1434..1441
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1328..1335
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 344..351

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

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

func encodeVarintHealth(dAtA []byte, offset int, v uint64) int {
    offset -= sovHealth(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/health.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
api/dispatcher.pb.go on lines 2431..2441
api/logbroker.pb.go on lines 1704..1714
api/objects.pb.go on lines 2619..2629
api/raft.pb.go on lines 2074..2084
api/resource.pb.go on lines 552..562
api/snapshot.pb.go on lines 616..626
api/specs.pb.go on lines 3784..3794
api/watch.pb.go on lines 2137..2147
protobuf/plugin/plugin.pb.go on lines 526..536

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

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

func (c *raftMembershipClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) {
    out := new(JoinResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Join", in, out, opts...)
    if err != nil {
        return nil, err
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 35 mins to fix
api/ca.pb.go on lines 599..606
api/ca.pb.go on lines 608..615
api/ca.pb.go on lines 709..716
api/ca.pb.go on lines 718..725
api/dispatcher.pb.go on lines 1416..1423
api/dispatcher.pb.go on lines 1425..1432
api/dispatcher.pb.go on lines 1434..1441
api/health.pb.go on lines 245..252
api/raft.pb.go on lines 1140..1147
api/raft.pb.go on lines 1183..1190
api/raft.pb.go on lines 1337..1344
api/resource.pb.go on lines 335..342
api/resource.pb.go on lines 344..351

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

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