docker/docker

View on GitHub

Showing 443 of 1,855 total issues

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/types/swarm/runtime/plugin.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field EndpointIP", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/drivers/overlay/overlay.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 4:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 6:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field TunnelEndpointIP", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/drivers/overlay/overlay.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 2:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Remote", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/types/swarm/runtime/plugin.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/types/swarm/runtime/plugin.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 5:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578

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

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

        case 2:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field EndpointMAC", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/drivers/overlay/overlay.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 2:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
            }
            var stringLen uint64
Severity: Major
Found in api/types/plugins/logdriver/entry.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 5:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field EndpointIP", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 3:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 4:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 647..678
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

        case 1:
            if wireType != 2 {
                return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
            }
            var stringLen uint64
Severity: Major
Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
api/types/plugins/logdriver/entry.pb.go on lines 389..420
api/types/plugins/logdriver/entry.pb.go on lines 600..631
api/types/swarm/runtime/plugin.pb.go on lines 408..439
api/types/swarm/runtime/plugin.pb.go on lines 440..471
api/types/swarm/runtime/plugin.pb.go on lines 608..639
api/types/swarm/runtime/plugin.pb.go on lines 640..671
libnetwork/agent.pb.go on lines 679..710
libnetwork/agent.pb.go on lines 711..742
libnetwork/agent.pb.go on lines 743..774
libnetwork/agent.pb.go on lines 775..806
libnetwork/agent.pb.go on lines 975..1006
libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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