docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

func (m *NetworkSpec_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.Network)
    copy(dAtA[i:], m.Network)
    i = encodeVarintSpecs(dAtA, i, uint64(len(m.Network)))
Severity: Major
Found in api/specs.pb.go and 9 other locations - About 50 mins to fix
api/watch.pb.go on lines 1692..1700
api/watch.pb.go on lines 1706..1714
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1734..1742
api/watch.pb.go on lines 1790..1798
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1889..1897
api/watch.pb.go on lines 1903..1911

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

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

func (m *SelectBy_NamePrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.NamePrefix)
    copy(dAtA[i:], m.NamePrefix)
    i = encodeVarintWatch(dAtA, i, uint64(len(m.NamePrefix)))
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/specs.pb.go on lines 3461..3469
api/watch.pb.go on lines 1692..1700
api/watch.pb.go on lines 1706..1714
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1790..1798
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1889..1897
api/watch.pb.go on lines 1903..1911

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

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

func (m *SelectBy_Kind) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.Kind)
    copy(dAtA[i:], m.Kind)
    i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/specs.pb.go on lines 3461..3469
api/watch.pb.go on lines 1692..1700
api/watch.pb.go on lines 1706..1714
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1734..1742
api/watch.pb.go on lines 1790..1798
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1889..1897

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

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

func (m *SelectBy_ReferencedSecretID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.ReferencedSecretID)
    copy(dAtA[i:], m.ReferencedSecretID)
    i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedSecretID)))
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/specs.pb.go on lines 3461..3469
api/watch.pb.go on lines 1692..1700
api/watch.pb.go on lines 1706..1714
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1734..1742
api/watch.pb.go on lines 1790..1798
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1903..1911

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

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

func (m *SelectBy_ServiceID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.ServiceID)
    copy(dAtA[i:], m.ServiceID)
    i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID)))
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/specs.pb.go on lines 3461..3469
api/watch.pb.go on lines 1692..1700
api/watch.pb.go on lines 1706..1714
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1734..1742
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1889..1897
api/watch.pb.go on lines 1903..1911

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

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

func (m *SelectBy_ID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.ID)
    copy(dAtA[i:], m.ID)
    i = encodeVarintWatch(dAtA, i, uint64(len(m.ID)))
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/specs.pb.go on lines 3461..3469
api/watch.pb.go on lines 1706..1714
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1734..1742
api/watch.pb.go on lines 1790..1798
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1889..1897
api/watch.pb.go on lines 1903..1911

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

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

func (m *SelectBy_IDPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    i -= len(m.IDPrefix)
    copy(dAtA[i:], m.IDPrefix)
    i = encodeVarintWatch(dAtA, i, uint64(len(m.IDPrefix)))
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/specs.pb.go on lines 3461..3469
api/watch.pb.go on lines 1692..1700
api/watch.pb.go on lines 1720..1728
api/watch.pb.go on lines 1734..1742
api/watch.pb.go on lines 1790..1798
api/watch.pb.go on lines 1804..1812
api/watch.pb.go on lines 1875..1883
api/watch.pb.go on lines 1889..1897
api/watch.pb.go on lines 1903..1911

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

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

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

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

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

Refactorings

Further Reading

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

func (m *ReplicatedService) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Major
Found in api/specs.pb.go and 2 other locations - About 50 mins to fix
api/health.pb.go on lines 347..358
api/raft.pb.go on lines 1742..1753

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

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

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

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

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

Refactorings

Further Reading

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

func (m *TasksMessage) Size() (n int) {
    if m == nil {
        return 0
    }
    var l int
Severity: Minor
Found in api/dispatcher.pb.go and 1 other location - About 50 mins to fix
api/logbroker.pb.go on lines 2153..2166

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

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

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

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

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

Refactorings

Further Reading

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

func (m *SubscribeLogsMessage) Size() (n int) {
    if m == nil {
        return 0
    }
    var l int
Severity: Minor
Found in api/logbroker.pb.go and 1 other location - About 50 mins to fix
api/dispatcher.pb.go on lines 2949..2962

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

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

func (p *raftProxyLogBrokerServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/logbroker.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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

func (p *raftProxyRaftMembershipServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/raft.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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

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

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

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

Refactorings

Further Reading

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

    if len(m.DriverAttachmentOpts) > 0 {
        for k, v := range m.DriverAttachmentOpts {
            _ = k
            _ = v
            mapEntrySize := 1 + len(k) + sovObjects(uint64(len(k))) + 1 + len(v) + sovObjects(uint64(len(v)))
Severity: Major
Found in api/objects.pb.go and 2 other locations - About 50 mins to fix
api/specs.pb.go on lines 4089..4096
api/specs.pb.go on lines 4200..4207

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

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

func (p *raftProxyResourceAllocatorServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/resource.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/watch.pb.go on lines 2187..2196

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

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

func (p *raftProxyLogsServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/logbroker.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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

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

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

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

Refactorings

Further Reading

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

    if len(m.Labels) > 0 {
        for k, v := range m.Labels {
            _ = k
            _ = v
            mapEntrySize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v)))
Severity: Major
Found in api/specs.pb.go and 2 other locations - About 50 mins to fix
api/objects.pb.go on lines 2873..2880
api/specs.pb.go on lines 4200..4207

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

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

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

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

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

Refactorings

Further Reading

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

        case request.Filters != nil && len(request.Filters.Memberships) > 0:
            filters := make([]store.By, 0, len(request.Filters.Memberships))
            for _, v := range request.Filters.Memberships {
                filters = append(filters, store.ByMembership(v))
            }
Severity: Major
Found in manager/controlapi/node.go and 2 other locations - About 50 mins to fix
manager/controlapi/node.go on lines 92..97
manager/controlapi/task.go on lines 95..100

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

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

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

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

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

Refactorings

Further Reading

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

    if len(m.Sysctls) > 0 {
        for k, v := range m.Sysctls {
            _ = k
            _ = v
            mapEntrySize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v)))
Severity: Major
Found in api/specs.pb.go and 2 other locations - About 50 mins to fix
api/objects.pb.go on lines 2873..2880
api/specs.pb.go on lines 4089..4096

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

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

func (p *raftProxyHealthServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/health.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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

func (p *raftProxyRaftServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/raft.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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