docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

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

package flagparser

import (
    "fmt"
    "strings"
Severity: Major
Found in swarmd/cmd/swarmctl/service/flagparser/npipe.go and 1 other location - About 2 hrs to fix
swarmd/cmd/swarmctl/service/flagparser/bind.go on lines 1..37

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

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

package flagparser

import (
    "fmt"
    "strings"
Severity: Major
Found in swarmd/cmd/swarmctl/service/flagparser/bind.go and 1 other location - About 2 hrs to fix
swarmd/cmd/swarmctl/service/flagparser/npipe.go on lines 1..37

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

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

Method NetworkSpec.MarshalToSizedBuffer has 88 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (m *NetworkSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Major
Found in api/specs.pb.go - About 2 hrs to fix

    Method StoreObject.Unmarshal has 88 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (m *StoreObject) Unmarshal(dAtA []byte) error {
        var hasFields [1]uint64
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
    Severity: Major
    Found in protobuf/plugin/plugin.pb.go - About 2 hrs to fix

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

      func _RaftMembership_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(LeaveRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _Dispatcher_UpdateTaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(UpdateTaskStatusRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/dispatcher.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _RaftMembership_Join_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(JoinRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(HealthCheckRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/health.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _Dispatcher_UpdateVolumeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(UpdateVolumeStatusRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/dispatcher.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _Dispatcher_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(HeartbeatRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/dispatcher.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _NodeCA_NodeCertificateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(NodeCertificateStatusRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _Raft_ProcessRaftMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(ProcessRaftMessageRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _ResourceAllocator_DetachNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(DetachNetworkRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/resource.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390

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

      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 _NodeCA_IssueNodeCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(IssueNodeCertificateRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _ResourceAllocator_AttachNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(AttachNetworkRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/resource.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 392..408

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

      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 _CA_GetRootCACertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(GetRootCACertificateRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _CA_GetUnlockKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(GetUnlockKeyRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/ca.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1269..1285
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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 _Raft_ResolveAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(ResolveAddressRequest)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/raft.pb.go and 13 other locations - About 2 hrs to fix
      api/ca.pb.go on lines 640..656
      api/ca.pb.go on lines 658..674
      api/ca.pb.go on lines 748..764
      api/ca.pb.go on lines 766..782
      api/dispatcher.pb.go on lines 1593..1609
      api/dispatcher.pb.go on lines 1611..1627
      api/dispatcher.pb.go on lines 1629..1645
      api/health.pb.go on lines 271..287
      api/raft.pb.go on lines 1225..1241
      api/raft.pb.go on lines 1369..1385
      api/raft.pb.go on lines 1387..1403
      api/resource.pb.go on lines 374..390
      api/resource.pb.go on lines 392..408

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

      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

      Resource has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type Resource struct {
          ID          string      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
          Meta        Meta        `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"`
          Annotations Annotations `protobuf:"bytes,3,opt,name=annotations,proto3" json:"annotations"`
          // Kind identifies this class of object. It is essentially a namespace
      Severity: Minor
      Found in api/objects.pb.go - About 2 hrs to fix

        Task has 23 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type Task struct {
            ID   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
            Meta Meta   `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"`
            // Spec defines the desired state of the task as specified by the user.
            // The system will honor this and will *never* modify it.
        Severity: Minor
        Found in api/objects.pb.go - About 2 hrs to fix
          Severity
          Category
          Status
          Source
          Language