docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

func (p *raftProxyNodeCAServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/ca.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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 (p *raftProxyDispatcherServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/dispatcher.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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

        case request.Filters != nil && len(request.Filters.Roles) > 0:
            filters := make([]store.By, 0, len(request.Filters.Roles))
            for _, v := range request.Filters.Roles {
                filters = append(filters, store.ByRole(v))
            }
Severity: Major
Found in manager/controlapi/node.go and 2 other locations - About 50 mins to fix
manager/controlapi/node.go on lines 98..103
manager/controlapi/task.go on lines 95..100

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

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 (p *raftProxyCAServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/ca.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611
api/watch.pb.go on lines 2187..2196

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

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 (p *raftProxyWatchServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
    var err error
    for _, mod := range ctxMods {
        ctx, err = mod(ctx)
        if err != nil {
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 50 mins to fix
api/ca.pb.go on lines 1126..1135
api/ca.pb.go on lines 1268..1277
api/dispatcher.pb.go on lines 2481..2490
api/health.pb.go on lines 410..419
api/logbroker.pb.go on lines 1754..1763
api/logbroker.pb.go on lines 1877..1886
api/raft.pb.go on lines 2124..2133
api/raft.pb.go on lines 2323..2332
api/resource.pb.go on lines 602..611

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

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

        case request.Filters != nil && len(request.Filters.DesiredStates) > 0:
            filters := make([]store.By, 0, len(request.Filters.DesiredStates))
            for _, v := range request.Filters.DesiredStates {
                filters = append(filters, store.ByDesiredState(v))
            }
Severity: Major
Found in manager/controlapi/task.go and 2 other locations - About 50 mins to fix
manager/controlapi/node.go on lines 92..97
manager/controlapi/node.go on lines 98..103

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

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

    suite.NoError(s.Update(func(tx store.Tx) error {
        t2 := &api.Task{
            ID: "testTaskID2",
            Status: api.TaskStatus{
                State: api.TaskStateNew,
Severity: Minor
Found in manager/allocator/allocator_test_suite.go and 1 other location - About 50 mins to fix
manager/allocator/allocator_test_suite.go on lines 582..593

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

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

    suite.NoError(s.Update(func(tx store.Tx) error {
        t7 := &api.Task{
            ID: "testTaskID7",
            Status: api.TaskStatus{
                State: api.TaskStateNew,
Severity: Minor
Found in manager/allocator/allocator_test_suite.go and 1 other location - About 50 mins to fix
manager/allocator/allocator_test_suite.go on lines 344..355

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

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 (this *AttachNetworkRequest) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&AttachNetworkRequest{`,
Severity: Minor
Found in api/resource.pb.go and 1 other location - About 50 mins to fix
api/dispatcher.pb.go on lines 3085..3095

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

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 (this *UpdateTaskStatusRequest_TaskStatusUpdate) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&UpdateTaskStatusRequest_TaskStatusUpdate{`,
Severity: Minor
Found in api/dispatcher.pb.go and 1 other location - About 50 mins to fix
api/specs.pb.go on lines 4647..4657

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

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 (this *SessionRequest) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&SessionRequest{`,
Severity: Minor
Found in api/dispatcher.pb.go and 1 other location - About 50 mins to fix
api/resource.pb.go on lines 764..774

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

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 (this *GenericRuntimeSpec) String() string {
    if this == nil {
        return "nil"
    }
    s := strings.Join([]string{`&GenericRuntimeSpec{`,
Severity: Minor
Found in api/specs.pb.go and 1 other location - About 50 mins to fix
api/dispatcher.pb.go on lines 3156..3166

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

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 *StoreAction_Service:
        switch sa.Action {
        case StoreActionKindCreate:
            return EventCreateService{Service: v.Service}, nil
        case StoreActionKindUpdate:
Severity: Major
Found in api/objects.pb.go and 9 other locations - About 45 mins to fix
api/objects.pb.go on lines 5733..5745
api/objects.pb.go on lines 5759..5771
api/objects.pb.go on lines 5772..5784
api/objects.pb.go on lines 5785..5797
api/objects.pb.go on lines 5798..5810
api/objects.pb.go on lines 5811..5823
api/objects.pb.go on lines 5824..5836
api/objects.pb.go on lines 5837..5849
api/objects.pb.go on lines 5850..5862

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

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 *StoreAction_Resource:
        switch sa.Action {
        case StoreActionKindCreate:
            return EventCreateResource{Resource: v.Resource}, nil
        case StoreActionKindUpdate:
Severity: Major
Found in api/objects.pb.go and 9 other locations - About 45 mins to fix
api/objects.pb.go on lines 5733..5745
api/objects.pb.go on lines 5746..5758
api/objects.pb.go on lines 5759..5771
api/objects.pb.go on lines 5772..5784
api/objects.pb.go on lines 5785..5797
api/objects.pb.go on lines 5798..5810
api/objects.pb.go on lines 5811..5823
api/objects.pb.go on lines 5837..5849
api/objects.pb.go on lines 5850..5862

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

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 *StoreAction_Volume:
        switch sa.Action {
        case StoreActionKindCreate:
            return EventCreateVolume{Volume: v.Volume}, nil
        case StoreActionKindUpdate:
Severity: Major
Found in api/objects.pb.go and 9 other locations - About 45 mins to fix
api/objects.pb.go on lines 5733..5745
api/objects.pb.go on lines 5746..5758
api/objects.pb.go on lines 5759..5771
api/objects.pb.go on lines 5772..5784
api/objects.pb.go on lines 5785..5797
api/objects.pb.go on lines 5798..5810
api/objects.pb.go on lines 5811..5823
api/objects.pb.go on lines 5824..5836
api/objects.pb.go on lines 5837..5849

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

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 *StoreAction_Task:
        switch sa.Action {
        case StoreActionKindCreate:
            return EventCreateTask{Task: v.Task}, nil
        case StoreActionKindUpdate:
Severity: Major
Found in api/objects.pb.go and 9 other locations - About 45 mins to fix
api/objects.pb.go on lines 5733..5745
api/objects.pb.go on lines 5746..5758
api/objects.pb.go on lines 5772..5784
api/objects.pb.go on lines 5785..5797
api/objects.pb.go on lines 5798..5810
api/objects.pb.go on lines 5811..5823
api/objects.pb.go on lines 5824..5836
api/objects.pb.go on lines 5837..5849
api/objects.pb.go on lines 5850..5862

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

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

        in := &api.Network{
            ID: "overlay1",
            Spec: api.NetworkSpec{
                Annotations: api.Annotations{
                    Name: "net1",
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 2 other locations - About 45 mins to fix
manager/allocator/allocator_test_suite.go on lines 633..650
manager/allocator/allocator_test_suite.go on lines 1049..1066

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

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

        n1 = &api.Network{
            ID: "testID1",
            Spec: api.NetworkSpec{
                Annotations: api.Annotations{
                    Name: "test1",
Severity: Major
Found in manager/allocator/allocator_test_suite.go and 2 other locations - About 45 mins to fix
manager/allocator/allocator_test_suite.go on lines 633..650
manager/allocator/allocator_test_suite.go on lines 880..897

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

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 *StoreAction_Node:
        switch sa.Action {
        case StoreActionKindCreate:
            return EventCreateNode{Node: v.Node}, nil
        case StoreActionKindUpdate:
Severity: Major
Found in api/objects.pb.go and 9 other locations - About 45 mins to fix
api/objects.pb.go on lines 5746..5758
api/objects.pb.go on lines 5759..5771
api/objects.pb.go on lines 5772..5784
api/objects.pb.go on lines 5785..5797
api/objects.pb.go on lines 5798..5810
api/objects.pb.go on lines 5811..5823
api/objects.pb.go on lines 5824..5836
api/objects.pb.go on lines 5837..5849
api/objects.pb.go on lines 5850..5862

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

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 *StoreAction_Config:
        switch sa.Action {
        case StoreActionKindCreate:
            return EventCreateConfig{Config: v.Config}, nil
        case StoreActionKindUpdate:
Severity: Major
Found in api/objects.pb.go and 9 other locations - About 45 mins to fix
api/objects.pb.go on lines 5733..5745
api/objects.pb.go on lines 5746..5758
api/objects.pb.go on lines 5759..5771
api/objects.pb.go on lines 5772..5784
api/objects.pb.go on lines 5785..5797
api/objects.pb.go on lines 5798..5810
api/objects.pb.go on lines 5824..5836
api/objects.pb.go on lines 5837..5849
api/objects.pb.go on lines 5850..5862

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

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