docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

func (p *raftProxyCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyDispatcherServer) UpdateVolumeStatus(ctx context.Context, r *UpdateVolumeStatusRequest) (*UpdateVolumeStatusResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyDispatcherServer) Heartbeat(ctx context.Context, r *HeartbeatRequest) (*HeartbeatResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyResourceAllocatorServer) DetachNetwork(ctx context.Context, r *DetachNetworkRequest) (*DetachNetworkResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/resource.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669

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

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 (p *raftProxyCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyResourceAllocatorServer) AttachNetwork(ctx context.Context, r *AttachNetworkRequest) (*AttachNetworkResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/resource.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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 (p *raftProxyRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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

func (m *UpdateTaskStatusResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/dispatcher.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *GetUnlockKeyRequest) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/ca.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/raft.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *StreamRaftMessageResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/raft.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *GetRootCACertificateRequest) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/ca.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *UpdateVolumeStatusResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/dispatcher.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *GlobalJob) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/specs.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536

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

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

func (m *LeaveResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/raft.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/resource.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *PublishLogsResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/logbroker.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3399..3448
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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

func (m *ListenSubscriptionsRequest) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/logbroker.pb.go and 11 other locations - About 4 hrs to fix
api/ca.pb.go on lines 2044..2093
api/ca.pb.go on lines 2178..2227
api/dispatcher.pb.go on lines 4071..4120
api/dispatcher.pb.go on lines 4339..4388
api/logbroker.pb.go on lines 3759..3808
api/raft.pb.go on lines 3501..3550
api/raft.pb.go on lines 3637..3686
api/raft.pb.go on lines 3773..3822
api/resource.pb.go on lines 1094..1143
api/specs.pb.go on lines 5487..5536
api/specs.pb.go on lines 5625..5674

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

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