docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

    if storeObject.WatchSelectors.Custom != nil && *storeObject.WatchSelectors.Custom {
        d.P("case *SelectBy_Custom:")
        d.In()
        if _, hasNoSpec := typesWithNoSpec[*m.Name]; hasNoSpec {
            d.P(`if len(m.Annotations.Indices) != 0 {`)
Severity: Major
Found in protobuf/plugin/storeobject/storeobject.go and 1 other location - About 2 hrs to fix
protobuf/plugin/storeobject/storeobject.go on lines 477..497

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

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

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

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

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

Refactorings

Further Reading

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

    if storeObject.WatchSelectors.CustomPrefix != nil && *storeObject.WatchSelectors.CustomPrefix {
        d.P("case *SelectBy_CustomPrefix:")
        d.In()
        if _, hasNoSpec := typesWithNoSpec[*m.Name]; hasNoSpec {
            d.P(`if len(m.Annotations.Indices) != 0 {`)
Severity: Major
Found in protobuf/plugin/storeobject/storeobject.go and 1 other location - About 2 hrs to fix
protobuf/plugin/storeobject/storeobject.go on lines 456..476

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

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

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

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

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

Refactorings

Further Reading

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

package flagparser

import (
    "fmt"
    "strings"
Severity: Major
Found in swarmd/cmd/swarmctl/service/flagparser/bind.go and 1 other location - About 2 hrs to fix
swarmd/cmd/swarmctl/service/flagparser/npipe.go on lines 1..37

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

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

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

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

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

Refactorings

Further Reading

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

package flagparser

import (
    "fmt"
    "strings"
Severity: Major
Found in swarmd/cmd/swarmctl/service/flagparser/npipe.go and 1 other location - About 2 hrs to fix
swarmd/cmd/swarmctl/service/flagparser/bind.go on lines 1..37

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

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 _CA_GetUnlockKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(GetUnlockKeyRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _ResourceAllocator_AttachNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(AttachNetworkRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/resource.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 392..408

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

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 _Dispatcher_UpdateTaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(UpdateTaskStatusRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _ResourceAllocator_DetachNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(DetachNetworkRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/resource.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390

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

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 _RaftMembership_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(LeaveRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _NodeCA_NodeCertificateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(NodeCertificateStatusRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _CA_GetRootCACertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(GetRootCACertificateRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _NodeCA_IssueNodeCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(IssueNodeCertificateRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _Raft_ResolveAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(ResolveAddressRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _RaftMembership_Join_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(JoinRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _Dispatcher_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(HeartbeatRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _Raft_ProcessRaftMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(ProcessRaftMessageRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(HealthCheckRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/health.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/dispatcher.pb.go on lines 1629..1645
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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 _Dispatcher_UpdateVolumeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(UpdateVolumeStatusRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 2 hrs to fix
api/ca.pb.go on lines 640..656
api/ca.pb.go on lines 658..674
api/ca.pb.go on lines 748..764
api/ca.pb.go on lines 766..782
api/dispatcher.pb.go on lines 1593..1609
api/dispatcher.pb.go on lines 1611..1627
api/health.pb.go on lines 271..287
api/raft.pb.go on lines 1225..1241
api/raft.pb.go on lines 1269..1285
api/raft.pb.go on lines 1369..1385
api/raft.pb.go on lines 1387..1403
api/resource.pb.go on lines 374..390
api/resource.pb.go on lines 392..408

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

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 219.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 219.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language