docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

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

func (this *StoreAction) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&StoreAction{`,
Severity: Major
Found in api/raft.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/specs.pb.go on lines 4559..4569
api/specs.pb.go on lines 4636..4646
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 *raftClient) ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error) {
    out := new(ProcessRaftMessageResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ProcessRaftMessage", 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 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 11 locations. Consider refactoring.
Open

func encodeVarintDispatcher(dAtA []byte, offset int, v uint64) int {
    offset -= sovDispatcher(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/dispatcher.pb.go and 10 other locations - About 35 mins to fix
api/ca.pb.go on lines 1076..1086
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 3796..3806
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 encodeVarintWatch(dAtA []byte, offset int, v uint64) int {
    offset -= sovWatch(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/watch.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 3796..3806
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 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 3796..3806
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 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 *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 4636..4646
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 *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 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 4559..4569
api/specs.pb.go on lines 4636..4646
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 *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 4559..4569
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) Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) {
    out := new(HeartbeatResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/Heartbeat", 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 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 8 locations. Consider refactoring.
Open

func (this *SelectBySlot) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&SelectBySlot{`,
Severity: Major
Found in api/watch.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 4559..4569
api/specs.pb.go on lines 4636..4646

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 encodeVarintObjects(dAtA []byte, offset int, v uint64) int {
    offset -= sovObjects(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/objects.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/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 3796..3806
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 4559..4569
api/specs.pb.go on lines 4636..4646
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 *resourceAllocatorClient) DetachNetwork(ctx context.Context, in *DetachNetworkRequest, opts ...grpc.CallOption) (*DetachNetworkResponse, error) {
    out := new(DetachNetworkResponse)
    err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.ResourceAllocator/DetachNetwork", 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 335..342

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 3796..3806
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 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 3796..3806
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 encodeVarintCa(dAtA []byte, offset int, v uint64) int {
    offset -= sovCa(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/ca.pb.go and 10 other locations - About 35 mins to fix
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 3796..3806
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 encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int {
    offset -= sovSnapshot(v)
    base := offset
    for v >= 1<<7 {
        dAtA[offset] = uint8(v&0x7f | 0x80)
Severity: Major
Found in api/snapshot.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/specs.pb.go on lines 3796..3806
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

Severity
Category
Status
Source
Language