docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

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

        case "secret":
            if selector.id != "" {
                object := store.GetSecret(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 298..313
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 330..345
swarmd/cmd/swarm-rafttool/dump.go on lines 346..361
swarmd/cmd/swarm-rafttool/dump.go on lines 362..377
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 410..425
swarmd/cmd/swarm-rafttool/dump.go on lines 426..441

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

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

        case "extension":
            if selector.id != "" {
                object := store.GetExtension(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 298..313
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 330..345
swarmd/cmd/swarm-rafttool/dump.go on lines 346..361
swarmd/cmd/swarm-rafttool/dump.go on lines 362..377
swarmd/cmd/swarm-rafttool/dump.go on lines 378..393
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 410..425

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

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

        case "cluster":
            if selector.id != "" {
                object := store.GetCluster(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 298..313
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 330..345
swarmd/cmd/swarm-rafttool/dump.go on lines 346..361
swarmd/cmd/swarm-rafttool/dump.go on lines 378..393
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 410..425
swarmd/cmd/swarm-rafttool/dump.go on lines 426..441

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

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

        case "node":
            if selector.id != "" {
                object := store.GetNode(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 330..345
swarmd/cmd/swarm-rafttool/dump.go on lines 346..361
swarmd/cmd/swarm-rafttool/dump.go on lines 362..377
swarmd/cmd/swarm-rafttool/dump.go on lines 378..393
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 410..425
swarmd/cmd/swarm-rafttool/dump.go on lines 426..441

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

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

        case "task":
            if selector.id != "" {
                object := store.GetTask(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 298..313
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 346..361
swarmd/cmd/swarm-rafttool/dump.go on lines 362..377
swarmd/cmd/swarm-rafttool/dump.go on lines 378..393
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 410..425
swarmd/cmd/swarm-rafttool/dump.go on lines 426..441

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

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

        case "resource":
            if selector.id != "" {
                object := store.GetResource(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 298..313
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 330..345
swarmd/cmd/swarm-rafttool/dump.go on lines 346..361
swarmd/cmd/swarm-rafttool/dump.go on lines 362..377
swarmd/cmd/swarm-rafttool/dump.go on lines 378..393
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 426..441

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

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

        case "network":
            if selector.id != "" {
                object := store.GetNetwork(tx, selector.id)
                if object != nil {
                    objects = append(objects, object)
Severity: Major
Found in swarmd/cmd/swarm-rafttool/dump.go and 8 other locations - About 55 mins to fix
swarmd/cmd/swarm-rafttool/dump.go on lines 298..313
swarmd/cmd/swarm-rafttool/dump.go on lines 314..329
swarmd/cmd/swarm-rafttool/dump.go on lines 330..345
swarmd/cmd/swarm-rafttool/dump.go on lines 362..377
swarmd/cmd/swarm-rafttool/dump.go on lines 378..393
swarmd/cmd/swarm-rafttool/dump.go on lines 394..409
swarmd/cmd/swarm-rafttool/dump.go on lines 410..425
swarmd/cmd/swarm-rafttool/dump.go on lines 426..441

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

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language