docker/swarmkit

View on GitHub

Showing 812 of 1,820 total issues

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

func (m *HealthCheckResponse) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/health.pb.go and 2 other locations - About 6 hrs to fix
api/raft.pb.go on lines 3823..3891
api/specs.pb.go on lines 5418..5486

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

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 *LogSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Major
Found in api/logbroker.pb.go and 1 other location - About 6 hrs to fix
api/specs.pb.go on lines 3221..3254

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

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 *ContainerSpec_DNSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Major
Found in api/specs.pb.go and 1 other location - About 6 hrs to fix
api/logbroker.pb.go on lines 1269..1302

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

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 NewRaftProxyResourceAllocatorServer(local ResourceAllocatorServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) ResourceAllocatorServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/resource.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyLogBrokerServer(local LogBrokerServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogBrokerServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/logbroker.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyRaftServer(local RaftServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/raft.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyNodeCAServer(local NodeCAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) NodeCAServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/ca.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyWatchServer(local WatchServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) WatchServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/watch.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601

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

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 NewRaftProxyRaftMembershipServer(local RaftMembershipServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftMembershipServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/raft.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyHealthServer(local HealthServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) HealthServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/health.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyDispatcherServer(local DispatcherServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) DispatcherServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/dispatcher.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyCAServer(local CAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) CAServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/ca.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1722..1753
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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 NewRaftProxyLogsServer(local LogsServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogsServer {
    redirectChecker := func(ctx context.Context) (context.Context, error) {
        p, ok := peer.FromContext(ctx)
        if !ok {
            return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
Severity: Major
Found in api/logbroker.pb.go and 9 other locations - About 5 hrs to fix
api/ca.pb.go on lines 1094..1125
api/ca.pb.go on lines 1236..1267
api/dispatcher.pb.go on lines 2449..2480
api/health.pb.go on lines 378..409
api/logbroker.pb.go on lines 1845..1876
api/raft.pb.go on lines 2092..2123
api/raft.pb.go on lines 2291..2322
api/resource.pb.go on lines 570..601
api/watch.pb.go on lines 2155..2186

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

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

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

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

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

Refactorings

Further Reading

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

    for _, filter := range filters {
        switch v := filter.By.(type) {
        case *SelectBy_ID:
            if m.ID != "" {
                return nil, errConflictingFilters
Severity: Major
Found in api/objects.pb.go and 1 other location - About 5 hrs to fix
api/objects.pb.go on lines 5291..5330

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

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

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

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

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

Refactorings

Further Reading

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

    for _, filter := range filters {
        switch v := filter.By.(type) {
        case *SelectBy_ID:
            if m.ID != "" {
                return nil, errConflictingFilters
Severity: Major
Found in api/objects.pb.go and 1 other location - About 5 hrs to fix
api/objects.pb.go on lines 5045..5084

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

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

func (p *raftProxyNodeCAServer) NodeCertificateStatus(ctx context.Context, r *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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

func (p *raftProxyDispatcherServer) UpdateTaskStatus(ctx context.Context, r *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/dispatcher.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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

func (p *raftProxyNodeCAServer) IssueNodeCertificate(ctx context.Context, r *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/ca.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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

func (p *raftProxyHealthServer) Check(ctx context.Context, r *HealthCheckRequest) (*HealthCheckResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/health.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/raft.pb.go on lines 2158..2191
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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

func (p *raftProxyRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/raft.pb.go and 13 other locations - About 4 hrs to fix
api/ca.pb.go on lines 1160..1193
api/ca.pb.go on lines 1195..1228
api/ca.pb.go on lines 1302..1335
api/ca.pb.go on lines 1337..1370
api/dispatcher.pb.go on lines 2566..2599
api/dispatcher.pb.go on lines 2601..2634
api/dispatcher.pb.go on lines 2636..2669
api/health.pb.go on lines 444..477
api/raft.pb.go on lines 2250..2283
api/raft.pb.go on lines 2357..2390
api/raft.pb.go on lines 2392..2425
api/resource.pb.go on lines 636..669
api/resource.pb.go on lines 671..704

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

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