dotcloud/docker

View on GitHub

Showing 445 of 1,885 total issues

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

func (sr *swarmRouter) getTaskLogs(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
    if err := httputils.ParseForm(r); err != nil {
        return err
    }

Severity: Major
Found in api/server/router/swarm/cluster_routes.go and 1 other location - About 1 hr to fix
api/server/router/swarm/cluster_routes.go on lines 304..314

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

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

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

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

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

Refactorings

Further Reading

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

        for key in stasks.keys():
            if key not in realmark:
                print "LB Index %s" % key, "present in docker daemon but missing in IPVS"
                del stasks[key]
Severity: Major
Found in libnetwork/cmd/ssd/ssd.py and 1 other location - About 1 hr to fix
libnetwork/cmd/ssd/ssd.py on lines 110..113

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

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

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

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

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

Refactorings

Further Reading

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

        for key in realmark.keys():
            if key not in stasks:
                print "LB Index %s" % key, "present in IPVS but missing in docker daemon"
                del realmark[key]
Severity: Major
Found in libnetwork/cmd/ssd/ssd.py and 1 other location - About 1 hr to fix
libnetwork/cmd/ssd/ssd.py on lines 115..118

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

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
            }
            m.LTime = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

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

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
            }
            m.LTime = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

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

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

        case 1:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
            }
            m.LTime = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
libnetwork/networkdb/networkdb.pb.go on lines 2432..2450

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

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
            }
            m.LTime = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

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

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

        case 1:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
            }
            m.LTime = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

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

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
            }
            m.LTime = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

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

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

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

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

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

Refactorings

Further Reading

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

    case NodeEventTypeJoin:
        moved, err := nDB.changeNodeState(n.Name, nodeActiveState)
        if err != nil {
            log.G(context.TODO()).WithError(err).Error("unable to find the node to move")
            return false
Severity: Major
Found in libnetwork/networkdb/delegate.go and 1 other location - About 1 hr to fix
libnetwork/networkdb/delegate.go on lines 60..69

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

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

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

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

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

Refactorings

Further Reading

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

func (n *Namespace) UnsetGatewayIPv6() error {
    gwv6 := n.GatewayIPv6()
    if len(gwv6) == 0 {
        return nil
    }
Severity: Major
Found in libnetwork/osl/route_linux.go and 1 other location - About 1 hr to fix
libnetwork/osl/route_linux.go on lines 61..74

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

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

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

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

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

Refactorings

Further Reading

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

func (n *Namespace) UnsetGateway() error {
    gw := n.Gateway()
    if len(gw) == 0 {
        return nil
    }
Severity: Major
Found in libnetwork/osl/route_linux.go and 1 other location - About 1 hr to fix
libnetwork/osl/route_linux.go on lines 158..172

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

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

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

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

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

Refactorings

Further Reading

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

    case NodeEventTypeLeave:
        moved, err := nDB.changeNodeState(n.Name, nodeLeftState)
        if err != nil {
            log.G(context.TODO()).WithError(err).Error("unable to find the node to move")
            return false
Severity: Major
Found in libnetwork/networkdb/delegate.go and 1 other location - About 1 hr to fix
libnetwork/networkdb/delegate.go on lines 50..59

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

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

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

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

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

Refactorings

Further Reading

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

package client // import "github.com/docker/docker/client"

import (
    "context"
    "net/url"
Severity: Major
Found in client/plugin_remove.go and 1 other location - About 1 hr to fix
client/node_remove.go on lines 1..20

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

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

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

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

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

Refactorings

Further Reading

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

package client // import "github.com/docker/docker/client"

import (
    "context"
    "net/url"
Severity: Major
Found in client/node_remove.go and 1 other location - About 1 hr to fix
client/plugin_remove.go on lines 1..20

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

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

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

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

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

Refactorings

Further Reading

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

        case 1:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
            }
            m.Type = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 9 other locations - About 1 hr to fix
api/types/plugins/logdriver/entry.pb.go on lines 421..439
api/types/plugins/logdriver/entry.pb.go on lines 632..650
libnetwork/agent.pb.go on lines 1007..1025
libnetwork/agent.pb.go on lines 1026..1044
libnetwork/agent.pb.go on lines 1045..1063
libnetwork/networkdb/networkdb.pb.go on lines 1750..1768
libnetwork/networkdb/networkdb.pb.go on lines 1853..1871
libnetwork/networkdb/networkdb.pb.go on lines 1973..1991
libnetwork/networkdb/networkdb.pb.go on lines 2613..2631

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

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

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

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

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

Refactorings

Further Reading

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

func (this *PeerRecord) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&PeerRecord{`,
Severity: Major
Found in libnetwork/drivers/overlay/overlay.pb.go and 2 other locations - About 1 hr to fix
libnetwork/drivers/windows/overlay/overlay.pb.go on lines 175..186
libnetwork/networkdb/networkdb.pb.go on lines 1602..1613

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

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

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

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

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

Refactorings

Further Reading

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

        case 1:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
            }
            m.Type = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 9 other locations - About 1 hr to fix
api/types/plugins/logdriver/entry.pb.go on lines 421..439
api/types/plugins/logdriver/entry.pb.go on lines 632..650
libnetwork/agent.pb.go on lines 1007..1025
libnetwork/agent.pb.go on lines 1026..1044
libnetwork/agent.pb.go on lines 1045..1063
libnetwork/networkdb/networkdb.pb.go on lines 1853..1871
libnetwork/networkdb/networkdb.pb.go on lines 1973..1991
libnetwork/networkdb/networkdb.pb.go on lines 2413..2431
libnetwork/networkdb/networkdb.pb.go on lines 2613..2631

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

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

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

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

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

Refactorings

Further Reading

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

        case 1:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
            }
            m.Type = 0
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 9 other locations - About 1 hr to fix
api/types/plugins/logdriver/entry.pb.go on lines 421..439
api/types/plugins/logdriver/entry.pb.go on lines 632..650
libnetwork/agent.pb.go on lines 1007..1025
libnetwork/agent.pb.go on lines 1026..1044
libnetwork/agent.pb.go on lines 1045..1063
libnetwork/networkdb/networkdb.pb.go on lines 1750..1768
libnetwork/networkdb/networkdb.pb.go on lines 1973..1991
libnetwork/networkdb/networkdb.pb.go on lines 2413..2431
libnetwork/networkdb/networkdb.pb.go on lines 2613..2631

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

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

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

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

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

Refactorings

Further Reading

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

        case 3:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Ordinal", wireType)
            }
            m.Ordinal = 0
Severity: Major
Found in api/types/plugins/logdriver/entry.pb.go and 9 other locations - About 1 hr to fix
api/types/plugins/logdriver/entry.pb.go on lines 421..439
libnetwork/agent.pb.go on lines 1007..1025
libnetwork/agent.pb.go on lines 1026..1044
libnetwork/agent.pb.go on lines 1045..1063
libnetwork/networkdb/networkdb.pb.go on lines 1750..1768
libnetwork/networkdb/networkdb.pb.go on lines 1853..1871
libnetwork/networkdb/networkdb.pb.go on lines 1973..1991
libnetwork/networkdb/networkdb.pb.go on lines 2413..2431
libnetwork/networkdb/networkdb.pb.go on lines 2613..2631

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

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