dotcloud/docker

View on GitHub

Showing 445 of 1,885 total issues

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

        case 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
            }
            m.Protocol = 0
Severity: Major
Found in libnetwork/agent.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 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

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

        case 8:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field ResidualReapTime", wireType)
            }
            m.ResidualReapTime = 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 2413..2431

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 1853..1871
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 3 locations. Consider refactoring.
Open

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

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/windows/overlay/overlay.pb.go and 2 other locations - About 1 hr to fix
libnetwork/drivers/overlay/overlay.pb.go on lines 223..234
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 2:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field TimeNano", wireType)
            }
            m.TimeNano = 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 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 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 TargetPort", wireType)
            }
            m.TargetPort = 0
Severity: Major
Found in libnetwork/agent.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 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

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

        case 4:
            if wireType != 0 {
                return fmt.Errorf("proto: wrong wireType = %d for field PublishedPort", wireType)
            }
            m.PublishedPort = 0
Severity: Major
Found in libnetwork/agent.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/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

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

        if !iptable.Exists(Nat, "PREROUTING", preroute...) && enable {
            if err := c.Prerouting(Append, preroute...); err != nil {
                return fmt.Errorf("failed to inject %s in PREROUTING chain: %s", c.Name, err)
            }
        } else if iptable.Exists(Nat, "PREROUTING", preroute...) && !enable {
Severity: Minor
Found in libnetwork/iptables/iptables.go and 1 other location - About 1 hr to fix
libnetwork/iptables/iptables.go on lines 238..246

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

        if !iptable.Exists(Nat, "OUTPUT", output...) && enable {
            if err := c.Output(Append, output...); err != nil {
                return fmt.Errorf("failed to inject %s in OUTPUT chain: %s", c.Name, err)
            }
        } else if iptable.Exists(Nat, "OUTPUT", output...) && !enable {
Severity: Minor
Found in libnetwork/iptables/iptables.go and 1 other location - About 1 hr to fix
libnetwork/iptables/iptables.go on lines 221..229

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

    if len(m.Value) > 0 {
        for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- {
            i -= len(m.Value[iNdEx])
            copy(dAtA[i:], m.Value[iNdEx])
            i = encodeVarintPlugin(dAtA, i, uint64(len(m.Value[iNdEx])))
Severity: Major
Found in api/types/swarm/runtime/plugin.pb.go and 4 other locations - About 55 mins to fix
api/types/swarm/runtime/plugin.pb.go on lines 211..219
libnetwork/agent.pb.go on lines 370..378
libnetwork/agent.pb.go on lines 379..387
libnetwork/networkdb/networkdb.pb.go on lines 1275..1283

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

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

    if len(m.Networks) > 0 {
        for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- {
            i -= len(m.Networks[iNdEx])
            copy(dAtA[i:], m.Networks[iNdEx])
            i = encodeVarintNetworkdb(dAtA, i, uint64(len(m.Networks[iNdEx])))
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 4 other locations - About 55 mins to fix
api/types/swarm/runtime/plugin.pb.go on lines 211..219
api/types/swarm/runtime/plugin.pb.go on lines 281..289
libnetwork/agent.pb.go on lines 370..378
libnetwork/agent.pb.go on lines 379..387

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

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

    if len(m.Aliases) > 0 {
        for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- {
            i -= len(m.Aliases[iNdEx])
            copy(dAtA[i:], m.Aliases[iNdEx])
            i = encodeVarintAgent(dAtA, i, uint64(len(m.Aliases[iNdEx])))
Severity: Major
Found in libnetwork/agent.pb.go and 4 other locations - About 55 mins to fix
api/types/swarm/runtime/plugin.pb.go on lines 211..219
api/types/swarm/runtime/plugin.pb.go on lines 281..289
libnetwork/agent.pb.go on lines 370..378
libnetwork/networkdb/networkdb.pb.go on lines 1275..1283

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

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

    if len(m.Env) > 0 {
        for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- {
            i -= len(m.Env[iNdEx])
            copy(dAtA[i:], m.Env[iNdEx])
            i = encodeVarintPlugin(dAtA, i, uint64(len(m.Env[iNdEx])))
Severity: Major
Found in api/types/swarm/runtime/plugin.pb.go and 4 other locations - About 55 mins to fix
api/types/swarm/runtime/plugin.pb.go on lines 281..289
libnetwork/agent.pb.go on lines 370..378
libnetwork/agent.pb.go on lines 379..387
libnetwork/networkdb/networkdb.pb.go on lines 1275..1283

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

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

    if len(m.TaskAliases) > 0 {
        for iNdEx := len(m.TaskAliases) - 1; iNdEx >= 0; iNdEx-- {
            i -= len(m.TaskAliases[iNdEx])
            copy(dAtA[i:], m.TaskAliases[iNdEx])
            i = encodeVarintAgent(dAtA, i, uint64(len(m.TaskAliases[iNdEx])))
Severity: Major
Found in libnetwork/agent.pb.go and 4 other locations - About 55 mins to fix
api/types/swarm/runtime/plugin.pb.go on lines 211..219
api/types/swarm/runtime/plugin.pb.go on lines 281..289
libnetwork/agent.pb.go on lines 379..387
libnetwork/networkdb/networkdb.pb.go on lines 1275..1283

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

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

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

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

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

Refactorings

Further Reading

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

        if iptable.ExistsNative("nat", "OUTPUT", "-d", resolverIP, "-j", outputChain) {
            if err := iptable.RawCombinedOutputNative("-t", "nat", "-F", outputChain); err != nil {
                setupErr = err
                return
            }
Severity: Minor
Found in libnetwork/resolver_unix.go and 1 other location - About 55 mins to fix
libnetwork/resolver_unix.go on lines 56..70

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

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

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

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

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

Refactorings

Further Reading

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

        if c.Privileges.SELinuxContext != nil {
            containerSpec.Privileges.SELinuxContext = &types.SELinuxContext{
                Disable: c.Privileges.SELinuxContext.Disable,
                User:    c.Privileges.SELinuxContext.User,
                Type:    c.Privileges.SELinuxContext.Type,
Severity: Minor
Found in daemon/cluster/convert/container.go and 1 other location - About 55 mins to fix
daemon/cluster/convert/container.go on lines 334..342

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

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

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

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

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

Refactorings

Further Reading

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

        if iptable.ExistsNative("nat", "POSTROUTING", "-d", resolverIP, "-j", postroutingChain) {
            if err := iptable.RawCombinedOutputNative("-t", "nat", "-F", postroutingChain); err != nil {
                setupErr = err
                return
            }
Severity: Minor
Found in libnetwork/resolver_unix.go and 1 other location - About 55 mins to fix
libnetwork/resolver_unix.go on lines 40..54

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

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

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

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

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

Refactorings

Further Reading

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

        if c.Privileges.SELinuxContext != nil {
            containerSpec.Privileges.SELinuxContext = &swarmapi.Privileges_SELinuxContext{
                Disable: c.Privileges.SELinuxContext.Disable,
                User:    c.Privileges.SELinuxContext.User,
                Type:    c.Privileges.SELinuxContext.Type,
Severity: Minor
Found in daemon/cluster/convert/container.go and 1 other location - About 55 mins to fix
daemon/cluster/convert/container.go on lines 64..72

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

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

    if len(m.Networks) > 0 {
        for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- {
            {
                size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i])
                if err != nil {
Severity: Major
Found in libnetwork/networkdb/networkdb.pb.go and 3 other locations - About 55 mins to fix
api/types/swarm/runtime/plugin.pb.go on lines 230..243
libnetwork/agent.pb.go on lines 388..401
libnetwork/networkdb/networkdb.pb.go on lines 1329..1342

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

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