docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

func (k configSorter) Less(i, j int) bool {
    iTime, err := gogotypes.TimestampFromProto(k[i].Meta.CreatedAt)
    if err != nil {
        panic(err)
    }
Severity: Minor
Found in swarmd/cmd/swarmctl/config/list.go and 1 other location - About 1 hr to fix
swarmd/cmd/swarmctl/secret/list.go on lines 21..31

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

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 err := batch.Update(func(tx store.Tx) error {
        err := store.UpdateNode(tx, node)

        if err == store.ErrSequenceConflict {
            storeNode := store.GetNode(tx, node.ID)
Severity: Minor
Found in manager/allocator/network.go and 1 other location - About 55 mins to fix
manager/allocator/network.go on lines 1248..1264

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

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 err := batch.Update(func(tx store.Tx) error {
        err := store.UpdateService(tx, s)

        if err == store.ErrSequenceConflict {
            storeService := store.GetService(tx, s.ID)
Severity: Minor
Found in manager/allocator/network.go and 1 other location - About 55 mins to fix
manager/allocator/network.go on lines 1106..1122

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

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

    suite.NoError(s.Update(func(tx store.Tx) error {
        // create a task assigned to this node that has a network attachment on
        // n1
        t2 := &api.Task{
            ID:           "task2",
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 2 other locations - About 55 mins to fix
manager/allocator/allocator_test_suite.go on lines 1271..1288
manager/allocator/allocator_test_suite.go on lines 1356..1373

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

    suite.NoError(s.Update(func(tx store.Tx) error {
        // create a task assigned to this node that has a network attachment on
        // n1
        t1 := &api.Task{
            ID:           "task1",
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 2 other locations - About 55 mins to fix
manager/allocator/allocator_test_suite.go on lines 1329..1346
manager/allocator/allocator_test_suite.go on lines 1356..1373

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

    suite.NoError(s.Update(func(tx store.Tx) error {
        // create a task assigned to this node that has a network attachment on
        // n1
        t3 := &api.Task{
            ID:           "task3",
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 2 other locations - About 55 mins to fix
manager/allocator/allocator_test_suite.go on lines 1271..1288
manager/allocator/allocator_test_suite.go on lines 1329..1346

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

        case "service":
            if selector.id != "" {
                object := store.GetService(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 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 "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 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 "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 "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 "config":
            if selector.id != "" {
                object := store.GetConfig(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 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 "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 "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 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_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_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 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

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

Severity
Category
Status
Source
Language