docker/swarmkit

View on GitHub
api/resource.pb.go

Summary

Maintainability
F
2 wks
Test Coverage

File resource.pb.go has 1126 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: github.com/docker/swarmkit/api/resource.proto

package api

Severity: Major
Found in api/resource.pb.go - About 2 days to fix

    Method AttachNetworkRequest.Unmarshal has a Cognitive Complexity of 89 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/resource.pb.go - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method AttachNetworkResponse.Unmarshal has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *AttachNetworkResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/resource.pb.go - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method DetachNetworkRequest.Unmarshal has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *DetachNetworkRequest) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/resource.pb.go - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function skipResource has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
    Open

    func skipResource(dAtA []byte) (n int, err error) {
        l := len(dAtA)
        iNdEx := 0
        depth := 0
        for iNdEx < l {
    Severity: Minor
    Found in api/resource.pb.go - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method AttachNetworkRequest.Unmarshal has 115 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Major
    Found in api/resource.pb.go - About 3 hrs to fix

      Method DetachNetworkRequest.Unmarshal has 79 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (m *DetachNetworkRequest) Unmarshal(dAtA []byte) error {
          l := len(dAtA)
          iNdEx := 0
          for iNdEx < l {
              preIndex := iNdEx
      Severity: Major
      Found in api/resource.pb.go - About 2 hrs to fix

        Method AttachNetworkResponse.Unmarshal has 79 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (m *AttachNetworkResponse) Unmarshal(dAtA []byte) error {
            l := len(dAtA)
            iNdEx := 0
            for iNdEx < l {
                preIndex := iNdEx
        Severity: Major
        Found in api/resource.pb.go - About 2 hrs to fix

          Function skipResource has 76 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func skipResource(dAtA []byte) (n int, err error) {
              l := len(dAtA)
              iNdEx := 0
              depth := 0
              for iNdEx < l {
          Severity: Major
          Found in api/resource.pb.go - About 2 hrs to fix

            Method AttachNetworkRequest.Unmarshal has 22 return statements (exceeds 4 allowed).
            Open

            func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error {
                l := len(dAtA)
                iNdEx := 0
                for iNdEx < l {
                    preIndex := iNdEx
            Severity: Major
            Found in api/resource.pb.go - About 2 hrs to fix

              Method DetachNetworkResponse.Unmarshal has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
              Open

              func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error {
                  l := len(dAtA)
                  iNdEx := 0
                  for iNdEx < l {
                      preIndex := iNdEx
              Severity: Minor
              Found in api/resource.pb.go - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method AttachNetworkResponse.Unmarshal has 15 return statements (exceeds 4 allowed).
              Open

              func (m *AttachNetworkResponse) Unmarshal(dAtA []byte) error {
                  l := len(dAtA)
                  iNdEx := 0
                  for iNdEx < l {
                      preIndex := iNdEx
              Severity: Major
              Found in api/resource.pb.go - About 1 hr to fix

                Method DetachNetworkRequest.Unmarshal has 15 return statements (exceeds 4 allowed).
                Open

                func (m *DetachNetworkRequest) Unmarshal(dAtA []byte) error {
                    l := len(dAtA)
                    iNdEx := 0
                    for iNdEx < l {
                        preIndex := iNdEx
                Severity: Major
                Found in api/resource.pb.go - About 1 hr to fix

                  Function skipResource has 11 return statements (exceeds 4 allowed).
                  Open

                  func skipResource(dAtA []byte) (n int, err error) {
                      l := len(dAtA)
                      iNdEx := 0
                      depth := 0
                      for iNdEx < l {
                  Severity: Major
                  Found in api/resource.pb.go - About 1 hr to fix

                    Method raftProxyResourceAllocatorServer.AttachNetwork has 9 return statements (exceeds 4 allowed).
                    Open

                    func (p *raftProxyResourceAllocatorServer) AttachNetwork(ctx context.Context, r *AttachNetworkRequest) (*AttachNetworkResponse, error) {
                    
                        conn, err := p.connSelector.LeaderConn(ctx)
                        if err != nil {
                            if err == raftselector.ErrIsLeader {
                    Severity: Major
                    Found in api/resource.pb.go - About 55 mins to fix

                      Method DetachNetworkResponse.Unmarshal has 9 return statements (exceeds 4 allowed).
                      Open

                      func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error {
                          l := len(dAtA)
                          iNdEx := 0
                          for iNdEx < l {
                              preIndex := iNdEx
                      Severity: Major
                      Found in api/resource.pb.go - About 55 mins to fix

                        Method raftProxyResourceAllocatorServer.DetachNetwork has 9 return statements (exceeds 4 allowed).
                        Open

                        func (p *raftProxyResourceAllocatorServer) DetachNetwork(ctx context.Context, r *DetachNetworkRequest) (*DetachNetworkResponse, error) {
                        
                            conn, err := p.connSelector.LeaderConn(ctx)
                            if err != nil {
                                if err == raftselector.ErrIsLeader {
                        Severity: Major
                        Found in api/resource.pb.go - About 55 mins to fix

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

                          func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error {
                              l := len(dAtA)
                              iNdEx := 0
                              for iNdEx < l {
                                  preIndex := iNdEx
                          Severity: Major
                          Found in api/resource.pb.go and 1 other location - About 1 day to fix
                          api/dispatcher.pb.go on lines 3334..3451

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

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

                          func (m *AttachNetworkResponse) Unmarshal(dAtA []byte) error {
                              l := len(dAtA)
                              iNdEx := 0
                              for iNdEx < l {
                                  preIndex := iNdEx
                          Severity: Major
                          Found in api/resource.pb.go and 10 other locations - About 1 day to fix
                          api/ca.pb.go on lines 1585..1666
                          api/dispatcher.pb.go on lines 3672..3753
                          api/dispatcher.pb.go on lines 4389..4470
                          api/dispatcher.pb.go on lines 4555..4636
                          api/health.pb.go on lines 538..619
                          api/raft.pb.go on lines 3154..3235
                          api/raft.pb.go on lines 3892..3973
                          api/resource.pb.go on lines 1012..1093
                          api/specs.pb.go on lines 6280..6361
                          api/specs.pb.go on lines 7500..7581

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

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

                          func (m *DetachNetworkRequest) Unmarshal(dAtA []byte) error {
                              l := len(dAtA)
                              iNdEx := 0
                              for iNdEx < l {
                                  preIndex := iNdEx
                          Severity: Major
                          Found in api/resource.pb.go and 10 other locations - About 1 day to fix
                          api/ca.pb.go on lines 1585..1666
                          api/dispatcher.pb.go on lines 3672..3753
                          api/dispatcher.pb.go on lines 4389..4470
                          api/dispatcher.pb.go on lines 4555..4636
                          api/health.pb.go on lines 538..619
                          api/raft.pb.go on lines 3154..3235
                          api/raft.pb.go on lines 3892..3973
                          api/resource.pb.go on lines 930..1011
                          api/specs.pb.go on lines 6280..6361
                          api/specs.pb.go on lines 7500..7581

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

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

                          func skipResource(dAtA []byte) (n int, err error) {
                              l := len(dAtA)
                              iNdEx := 0
                              depth := 0
                              for iNdEx < l {
                          Severity: Major
                          Found in api/resource.pb.go and 10 other locations - About 6 hrs to fix
                          api/ca.pb.go on lines 2345..2422
                          api/dispatcher.pb.go on lines 5099..5176
                          api/health.pb.go on lines 689..766
                          api/logbroker.pb.go on lines 3809..3886
                          api/objects.pb.go on lines 10049..10126
                          api/raft.pb.go on lines 4496..4573
                          api/snapshot.pb.go on lines 1528..1605
                          api/specs.pb.go on lines 9186..9263
                          api/watch.pb.go on lines 4796..4873
                          protobuf/plugin/plugin.pb.go on lines 1190..1267

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

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

                          func (p *raftProxyResourceAllocatorServer) DetachNetwork(ctx context.Context, r *DetachNetworkRequest) (*DetachNetworkResponse, error) {
                          
                              conn, err := p.connSelector.LeaderConn(ctx)
                              if err != nil {
                                  if err == raftselector.ErrIsLeader {
                          Severity: Major
                          Found in api/resource.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 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

                          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 *raftProxyResourceAllocatorServer) AttachNetwork(ctx context.Context, r *AttachNetworkRequest) (*AttachNetworkResponse, error) {
                          
                              conn, err := p.connSelector.LeaderConn(ctx)
                              if err != nil {
                                  if err == raftselector.ErrIsLeader {
                          Severity: Major
                          Found in api/resource.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 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 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 12 locations. Consider refactoring.
                          Open

                          func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error {
                              l := len(dAtA)
                              iNdEx := 0
                              for iNdEx < l {
                                  preIndex := iNdEx
                          Severity: Major
                          Found in api/resource.pb.go and 11 other locations - About 4 hrs to fix
                          api/ca.pb.go on lines 2044..2093
                          api/ca.pb.go on lines 2178..2227
                          api/dispatcher.pb.go on lines 4071..4120
                          api/dispatcher.pb.go on lines 4339..4388
                          api/logbroker.pb.go on lines 3399..3448
                          api/logbroker.pb.go on lines 3759..3808
                          api/raft.pb.go on lines 3501..3550
                          api/raft.pb.go on lines 3637..3686
                          api/raft.pb.go on lines 3773..3822
                          api/specs.pb.go on lines 5487..5536
                          api/specs.pb.go on lines 5625..5674

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

                          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 *AttachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                              i := len(dAtA)
                              _ = i
                              var l int
                              _ = l
                          Severity: Major
                          Found in api/resource.pb.go and 1 other location - About 2 hrs to fix
                          api/dispatcher.pb.go on lines 1741..1766

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

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

                          func (p *raftProxyResourceAllocatorServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
                              ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
                              defer ticker.Stop()
                              for {
                                  select {
                          Severity: Major
                          Found in api/resource.pb.go and 9 other locations - About 2 hrs to fix
                          api/ca.pb.go on lines 1136..1158
                          api/ca.pb.go on lines 1278..1300
                          api/dispatcher.pb.go on lines 2491..2513
                          api/health.pb.go on lines 420..442
                          api/logbroker.pb.go on lines 1764..1786
                          api/logbroker.pb.go on lines 1887..1909
                          api/raft.pb.go on lines 2134..2156
                          api/raft.pb.go on lines 2333..2355
                          api/watch.pb.go on lines 2197..2219

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

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

                          func (m *DetachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                              i := len(dAtA)
                              _ = i
                              var l int
                              _ = l
                          Severity: Major
                          Found in api/resource.pb.go and 10 other locations - About 1 hr to fix
                          api/ca.pb.go on lines 816..829
                          api/ca.pb.go on lines 998..1011
                          api/dispatcher.pb.go on lines 1860..1873
                          api/dispatcher.pb.go on lines 2137..2150
                          api/dispatcher.pb.go on lines 2204..2217
                          api/health.pb.go on lines 317..330
                          api/raft.pb.go on lines 1489..1502
                          api/raft.pb.go on lines 1770..1783
                          api/resource.pb.go on lines 484..497
                          api/specs.pb.go on lines 2804..2817

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

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

                          func (m *AttachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                              i := len(dAtA)
                              _ = i
                              var l int
                              _ = l
                          Severity: Major
                          Found in api/resource.pb.go and 10 other locations - About 1 hr to fix
                          api/ca.pb.go on lines 816..829
                          api/ca.pb.go on lines 998..1011
                          api/dispatcher.pb.go on lines 1860..1873
                          api/dispatcher.pb.go on lines 2137..2150
                          api/dispatcher.pb.go on lines 2204..2217
                          api/health.pb.go on lines 317..330
                          api/raft.pb.go on lines 1489..1502
                          api/raft.pb.go on lines 1770..1783
                          api/resource.pb.go on lines 514..527
                          api/specs.pb.go on lines 2804..2817

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

                          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 *AttachNetworkRequest) Size() (n int) {
                              if m == nil {
                                  return 0
                              }
                              var l int
                          Severity: Major
                          Found in api/resource.pb.go and 1 other location - About 1 hr to fix
                          api/dispatcher.pb.go on lines 2773..2788

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

                          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 *raftProxyResourceAllocatorServer) 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/resource.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/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 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 102 locations. Consider refactoring.
                          Open

                          func (m *DetachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                              if deterministic {
                                  return xxx_messageInfo_DetachNetworkRequest.Marshal(b, m, deterministic)
                              } else {
                                  b = b[:cap(b)]
                          Severity: Major
                          Found in api/resource.pb.go and 101 other locations - About 45 mins to fix
                          api/ca.pb.go on lines 50..61
                          api/ca.pb.go on lines 87..98
                          api/ca.pb.go on lines 131..142
                          api/ca.pb.go on lines 168..179
                          api/ca.pb.go on lines 203..214
                          api/ca.pb.go on lines 239..250
                          api/ca.pb.go on lines 274..285
                          api/ca.pb.go on lines 311..322
                          api/dispatcher.pb.go on lines 112..123
                          api/dispatcher.pb.go on lines 202..213
                          api/dispatcher.pb.go on lines 239..250
                          api/dispatcher.pb.go on lines 277..288
                          api/dispatcher.pb.go on lines 316..327
                          api/dispatcher.pb.go on lines 355..366
                          api/dispatcher.pb.go on lines 390..401
                          api/dispatcher.pb.go on lines 427..438
                          api/dispatcher.pb.go on lines 476..487
                          api/dispatcher.pb.go on lines 511..522
                          api/dispatcher.pb.go on lines 547..558
                          api/dispatcher.pb.go on lines 585..596
                          api/dispatcher.pb.go on lines 621..632
                          api/dispatcher.pb.go on lines 662..673
                          api/dispatcher.pb.go on lines 768..779
                          api/dispatcher.pb.go on lines 816..827
                          api/health.pb.go on lines 77..88
                          api/health.pb.go on lines 113..124
                          api/logbroker.pb.go on lines 105..116
                          api/logbroker.pb.go on lines 148..159
                          api/logbroker.pb.go on lines 187..198
                          api/logbroker.pb.go on lines 225..236
                          api/logbroker.pb.go on lines 273..284
                          api/logbroker.pb.go on lines 311..322
                          api/logbroker.pb.go on lines 347..358
                          api/logbroker.pb.go on lines 384..395
                          api/logbroker.pb.go on lines 432..443
                          api/logbroker.pb.go on lines 477..488
                          api/logbroker.pb.go on lines 512..523
                          api/objects.pb.go on lines 51..62
                          api/objects.pb.go on lines 123..134
                          api/objects.pb.go on lines 190..201
                          api/objects.pb.go on lines 235..246
                          api/objects.pb.go on lines 283..294
                          api/objects.pb.go on lines 382..393
                          api/objects.pb.go on lines 430..441
                          api/objects.pb.go on lines 486..497
                          api/objects.pb.go on lines 558..569
                          api/objects.pb.go on lines 602..613
                          api/objects.pb.go on lines 644..655
                          api/objects.pb.go on lines 692..703
                          api/objects.pb.go on lines 733..744
                          api/objects.pb.go on lines 790..801
                          api/raft.pb.go on lines 90..101
                          api/raft.pb.go on lines 127..138
                          api/raft.pb.go on lines 169..180
                          api/raft.pb.go on lines 205..216
                          api/raft.pb.go on lines 240..251
                          api/raft.pb.go on lines 276..287
                          api/raft.pb.go on lines 311..322
                          api/raft.pb.go on lines 348..359
                          api/raft.pb.go on lines 384..395
                          api/raft.pb.go on lines 421..432
                          api/raft.pb.go on lines 458..469
                          api/raft.pb.go on lines 498..509
                          api/raft.pb.go on lines 547..558
                          api/resource.pb.go on lines 51..62
                          api/resource.pb.go on lines 87..98
                          api/resource.pb.go on lines 158..169
                          api/snapshot.pb.go on lines 73..84
                          api/snapshot.pb.go on lines 111..122
                          api/snapshot.pb.go on lines 149..160
                          api/specs.pb.go on lines 211..222
                          api/specs.pb.go on lines 274..285
                          api/specs.pb.go on lines 380..391
                          api/specs.pb.go on lines 416..427
                          api/specs.pb.go on lines 461..472
                          api/specs.pb.go on lines 498..509
                          api/specs.pb.go on lines 565..576
                          api/specs.pb.go on lines 659..670
                          api/specs.pb.go on lines 696..707
                          api/specs.pb.go on lines 736..747
                          api/specs.pb.go on lines 888..899
                          api/specs.pb.go on lines 929..940
                          api/specs.pb.go on lines 974..985
                          api/specs.pb.go on lines 1012..1023
                          api/specs.pb.go on lines 1053..1064
                          api/specs.pb.go on lines 1116..1127
                          api/specs.pb.go on lines 1202..1213
                          api/specs.pb.go on lines 1249..1260
                          api/specs.pb.go on lines 1296..1307
                          api/specs.pb.go on lines 1373..1384
                          api/watch.pb.go on lines 95..106
                          api/watch.pb.go on lines 275..286
                          api/watch.pb.go on lines 313..324
                          api/watch.pb.go on lines 370..381
                          api/watch.pb.go on lines 633..644
                          api/watch.pb.go on lines 677..688
                          api/watch.pb.go on lines 719..730
                          api/watch.pb.go on lines 764..775
                          protobuf/plugin/plugin.pb.go on lines 58..69
                          protobuf/plugin/plugin.pb.go on lines 94..105
                          protobuf/plugin/plugin.pb.go on lines 135..146

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

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

                          func (m *AttachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                              if deterministic {
                                  return xxx_messageInfo_AttachNetworkRequest.Marshal(b, m, deterministic)
                              } else {
                                  b = b[:cap(b)]
                          Severity: Major
                          Found in api/resource.pb.go and 101 other locations - About 45 mins to fix
                          api/ca.pb.go on lines 50..61
                          api/ca.pb.go on lines 87..98
                          api/ca.pb.go on lines 131..142
                          api/ca.pb.go on lines 168..179
                          api/ca.pb.go on lines 203..214
                          api/ca.pb.go on lines 239..250
                          api/ca.pb.go on lines 274..285
                          api/ca.pb.go on lines 311..322
                          api/dispatcher.pb.go on lines 112..123
                          api/dispatcher.pb.go on lines 202..213
                          api/dispatcher.pb.go on lines 239..250
                          api/dispatcher.pb.go on lines 277..288
                          api/dispatcher.pb.go on lines 316..327
                          api/dispatcher.pb.go on lines 355..366
                          api/dispatcher.pb.go on lines 390..401
                          api/dispatcher.pb.go on lines 427..438
                          api/dispatcher.pb.go on lines 476..487
                          api/dispatcher.pb.go on lines 511..522
                          api/dispatcher.pb.go on lines 547..558
                          api/dispatcher.pb.go on lines 585..596
                          api/dispatcher.pb.go on lines 621..632
                          api/dispatcher.pb.go on lines 662..673
                          api/dispatcher.pb.go on lines 768..779
                          api/dispatcher.pb.go on lines 816..827
                          api/health.pb.go on lines 77..88
                          api/health.pb.go on lines 113..124
                          api/logbroker.pb.go on lines 105..116
                          api/logbroker.pb.go on lines 148..159
                          api/logbroker.pb.go on lines 187..198
                          api/logbroker.pb.go on lines 225..236
                          api/logbroker.pb.go on lines 273..284
                          api/logbroker.pb.go on lines 311..322
                          api/logbroker.pb.go on lines 347..358
                          api/logbroker.pb.go on lines 384..395
                          api/logbroker.pb.go on lines 432..443
                          api/logbroker.pb.go on lines 477..488
                          api/logbroker.pb.go on lines 512..523
                          api/objects.pb.go on lines 51..62
                          api/objects.pb.go on lines 123..134
                          api/objects.pb.go on lines 190..201
                          api/objects.pb.go on lines 235..246
                          api/objects.pb.go on lines 283..294
                          api/objects.pb.go on lines 382..393
                          api/objects.pb.go on lines 430..441
                          api/objects.pb.go on lines 486..497
                          api/objects.pb.go on lines 558..569
                          api/objects.pb.go on lines 602..613
                          api/objects.pb.go on lines 644..655
                          api/objects.pb.go on lines 692..703
                          api/objects.pb.go on lines 733..744
                          api/objects.pb.go on lines 790..801
                          api/raft.pb.go on lines 90..101
                          api/raft.pb.go on lines 127..138
                          api/raft.pb.go on lines 169..180
                          api/raft.pb.go on lines 205..216
                          api/raft.pb.go on lines 240..251
                          api/raft.pb.go on lines 276..287
                          api/raft.pb.go on lines 311..322
                          api/raft.pb.go on lines 348..359
                          api/raft.pb.go on lines 384..395
                          api/raft.pb.go on lines 421..432
                          api/raft.pb.go on lines 458..469
                          api/raft.pb.go on lines 498..509
                          api/raft.pb.go on lines 547..558
                          api/resource.pb.go on lines 87..98
                          api/resource.pb.go on lines 123..134
                          api/resource.pb.go on lines 158..169
                          api/snapshot.pb.go on lines 73..84
                          api/snapshot.pb.go on lines 111..122
                          api/snapshot.pb.go on lines 149..160
                          api/specs.pb.go on lines 211..222
                          api/specs.pb.go on lines 274..285
                          api/specs.pb.go on lines 380..391
                          api/specs.pb.go on lines 416..427
                          api/specs.pb.go on lines 461..472
                          api/specs.pb.go on lines 498..509
                          api/specs.pb.go on lines 565..576
                          api/specs.pb.go on lines 659..670
                          api/specs.pb.go on lines 696..707
                          api/specs.pb.go on lines 736..747
                          api/specs.pb.go on lines 888..899
                          api/specs.pb.go on lines 929..940
                          api/specs.pb.go on lines 974..985
                          api/specs.pb.go on lines 1012..1023
                          api/specs.pb.go on lines 1053..1064
                          api/specs.pb.go on lines 1116..1127
                          api/specs.pb.go on lines 1202..1213
                          api/specs.pb.go on lines 1249..1260
                          api/specs.pb.go on lines 1296..1307
                          api/specs.pb.go on lines 1373..1384
                          api/watch.pb.go on lines 95..106
                          api/watch.pb.go on lines 275..286
                          api/watch.pb.go on lines 313..324
                          api/watch.pb.go on lines 370..381
                          api/watch.pb.go on lines 633..644
                          api/watch.pb.go on lines 677..688
                          api/watch.pb.go on lines 719..730
                          api/watch.pb.go on lines 764..775
                          protobuf/plugin/plugin.pb.go on lines 58..69
                          protobuf/plugin/plugin.pb.go on lines 94..105
                          protobuf/plugin/plugin.pb.go on lines 135..146

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

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

                          func (m *AttachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                              if deterministic {
                                  return xxx_messageInfo_AttachNetworkResponse.Marshal(b, m, deterministic)
                              } else {
                                  b = b[:cap(b)]
                          Severity: Major
                          Found in api/resource.pb.go and 101 other locations - About 45 mins to fix
                          api/ca.pb.go on lines 50..61
                          api/ca.pb.go on lines 87..98
                          api/ca.pb.go on lines 131..142
                          api/ca.pb.go on lines 168..179
                          api/ca.pb.go on lines 203..214
                          api/ca.pb.go on lines 239..250
                          api/ca.pb.go on lines 274..285
                          api/ca.pb.go on lines 311..322
                          api/dispatcher.pb.go on lines 112..123
                          api/dispatcher.pb.go on lines 202..213
                          api/dispatcher.pb.go on lines 239..250
                          api/dispatcher.pb.go on lines 277..288
                          api/dispatcher.pb.go on lines 316..327
                          api/dispatcher.pb.go on lines 355..366
                          api/dispatcher.pb.go on lines 390..401
                          api/dispatcher.pb.go on lines 427..438
                          api/dispatcher.pb.go on lines 476..487
                          api/dispatcher.pb.go on lines 511..522
                          api/dispatcher.pb.go on lines 547..558
                          api/dispatcher.pb.go on lines 585..596
                          api/dispatcher.pb.go on lines 621..632
                          api/dispatcher.pb.go on lines 662..673
                          api/dispatcher.pb.go on lines 768..779
                          api/dispatcher.pb.go on lines 816..827
                          api/health.pb.go on lines 77..88
                          api/health.pb.go on lines 113..124
                          api/logbroker.pb.go on lines 105..116
                          api/logbroker.pb.go on lines 148..159
                          api/logbroker.pb.go on lines 187..198
                          api/logbroker.pb.go on lines 225..236
                          api/logbroker.pb.go on lines 273..284
                          api/logbroker.pb.go on lines 311..322
                          api/logbroker.pb.go on lines 347..358
                          api/logbroker.pb.go on lines 384..395
                          api/logbroker.pb.go on lines 432..443
                          api/logbroker.pb.go on lines 477..488
                          api/logbroker.pb.go on lines 512..523
                          api/objects.pb.go on lines 51..62
                          api/objects.pb.go on lines 123..134
                          api/objects.pb.go on lines 190..201
                          api/objects.pb.go on lines 235..246
                          api/objects.pb.go on lines 283..294
                          api/objects.pb.go on lines 382..393
                          api/objects.pb.go on lines 430..441
                          api/objects.pb.go on lines 486..497
                          api/objects.pb.go on lines 558..569
                          api/objects.pb.go on lines 602..613
                          api/objects.pb.go on lines 644..655
                          api/objects.pb.go on lines 692..703
                          api/objects.pb.go on lines 733..744
                          api/objects.pb.go on lines 790..801
                          api/raft.pb.go on lines 90..101
                          api/raft.pb.go on lines 127..138
                          api/raft.pb.go on lines 169..180
                          api/raft.pb.go on lines 205..216
                          api/raft.pb.go on lines 240..251
                          api/raft.pb.go on lines 276..287
                          api/raft.pb.go on lines 311..322
                          api/raft.pb.go on lines 348..359
                          api/raft.pb.go on lines 384..395
                          api/raft.pb.go on lines 421..432
                          api/raft.pb.go on lines 458..469
                          api/raft.pb.go on lines 498..509
                          api/raft.pb.go on lines 547..558
                          api/resource.pb.go on lines 51..62
                          api/resource.pb.go on lines 123..134
                          api/resource.pb.go on lines 158..169
                          api/snapshot.pb.go on lines 73..84
                          api/snapshot.pb.go on lines 111..122
                          api/snapshot.pb.go on lines 149..160
                          api/specs.pb.go on lines 211..222
                          api/specs.pb.go on lines 274..285
                          api/specs.pb.go on lines 380..391
                          api/specs.pb.go on lines 416..427
                          api/specs.pb.go on lines 461..472
                          api/specs.pb.go on lines 498..509
                          api/specs.pb.go on lines 565..576
                          api/specs.pb.go on lines 659..670
                          api/specs.pb.go on lines 696..707
                          api/specs.pb.go on lines 736..747
                          api/specs.pb.go on lines 888..899
                          api/specs.pb.go on lines 929..940
                          api/specs.pb.go on lines 974..985
                          api/specs.pb.go on lines 1012..1023
                          api/specs.pb.go on lines 1053..1064
                          api/specs.pb.go on lines 1116..1127
                          api/specs.pb.go on lines 1202..1213
                          api/specs.pb.go on lines 1249..1260
                          api/specs.pb.go on lines 1296..1307
                          api/specs.pb.go on lines 1373..1384
                          api/watch.pb.go on lines 95..106
                          api/watch.pb.go on lines 275..286
                          api/watch.pb.go on lines 313..324
                          api/watch.pb.go on lines 370..381
                          api/watch.pb.go on lines 633..644
                          api/watch.pb.go on lines 677..688
                          api/watch.pb.go on lines 719..730
                          api/watch.pb.go on lines 764..775
                          protobuf/plugin/plugin.pb.go on lines 58..69
                          protobuf/plugin/plugin.pb.go on lines 94..105
                          protobuf/plugin/plugin.pb.go on lines 135..146

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

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

                          func (m *DetachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                              if deterministic {
                                  return xxx_messageInfo_DetachNetworkResponse.Marshal(b, m, deterministic)
                              } else {
                                  b = b[:cap(b)]
                          Severity: Major
                          Found in api/resource.pb.go and 101 other locations - About 45 mins to fix
                          api/ca.pb.go on lines 50..61
                          api/ca.pb.go on lines 87..98
                          api/ca.pb.go on lines 131..142
                          api/ca.pb.go on lines 168..179
                          api/ca.pb.go on lines 203..214
                          api/ca.pb.go on lines 239..250
                          api/ca.pb.go on lines 274..285
                          api/ca.pb.go on lines 311..322
                          api/dispatcher.pb.go on lines 112..123
                          api/dispatcher.pb.go on lines 202..213
                          api/dispatcher.pb.go on lines 239..250
                          api/dispatcher.pb.go on lines 277..288
                          api/dispatcher.pb.go on lines 316..327
                          api/dispatcher.pb.go on lines 355..366
                          api/dispatcher.pb.go on lines 390..401
                          api/dispatcher.pb.go on lines 427..438
                          api/dispatcher.pb.go on lines 476..487
                          api/dispatcher.pb.go on lines 511..522
                          api/dispatcher.pb.go on lines 547..558
                          api/dispatcher.pb.go on lines 585..596
                          api/dispatcher.pb.go on lines 621..632
                          api/dispatcher.pb.go on lines 662..673
                          api/dispatcher.pb.go on lines 768..779
                          api/dispatcher.pb.go on lines 816..827
                          api/health.pb.go on lines 77..88
                          api/health.pb.go on lines 113..124
                          api/logbroker.pb.go on lines 105..116
                          api/logbroker.pb.go on lines 148..159
                          api/logbroker.pb.go on lines 187..198
                          api/logbroker.pb.go on lines 225..236
                          api/logbroker.pb.go on lines 273..284
                          api/logbroker.pb.go on lines 311..322
                          api/logbroker.pb.go on lines 347..358
                          api/logbroker.pb.go on lines 384..395
                          api/logbroker.pb.go on lines 432..443
                          api/logbroker.pb.go on lines 477..488
                          api/logbroker.pb.go on lines 512..523
                          api/objects.pb.go on lines 51..62
                          api/objects.pb.go on lines 123..134
                          api/objects.pb.go on lines 190..201
                          api/objects.pb.go on lines 235..246
                          api/objects.pb.go on lines 283..294
                          api/objects.pb.go on lines 382..393
                          api/objects.pb.go on lines 430..441
                          api/objects.pb.go on lines 486..497
                          api/objects.pb.go on lines 558..569
                          api/objects.pb.go on lines 602..613
                          api/objects.pb.go on lines 644..655
                          api/objects.pb.go on lines 692..703
                          api/objects.pb.go on lines 733..744
                          api/objects.pb.go on lines 790..801
                          api/raft.pb.go on lines 90..101
                          api/raft.pb.go on lines 127..138
                          api/raft.pb.go on lines 169..180
                          api/raft.pb.go on lines 205..216
                          api/raft.pb.go on lines 240..251
                          api/raft.pb.go on lines 276..287
                          api/raft.pb.go on lines 311..322
                          api/raft.pb.go on lines 348..359
                          api/raft.pb.go on lines 384..395
                          api/raft.pb.go on lines 421..432
                          api/raft.pb.go on lines 458..469
                          api/raft.pb.go on lines 498..509
                          api/raft.pb.go on lines 547..558
                          api/resource.pb.go on lines 51..62
                          api/resource.pb.go on lines 87..98
                          api/resource.pb.go on lines 123..134
                          api/snapshot.pb.go on lines 73..84
                          api/snapshot.pb.go on lines 111..122
                          api/snapshot.pb.go on lines 149..160
                          api/specs.pb.go on lines 211..222
                          api/specs.pb.go on lines 274..285
                          api/specs.pb.go on lines 380..391
                          api/specs.pb.go on lines 416..427
                          api/specs.pb.go on lines 461..472
                          api/specs.pb.go on lines 498..509
                          api/specs.pb.go on lines 565..576
                          api/specs.pb.go on lines 659..670
                          api/specs.pb.go on lines 696..707
                          api/specs.pb.go on lines 736..747
                          api/specs.pb.go on lines 888..899
                          api/specs.pb.go on lines 929..940
                          api/specs.pb.go on lines 974..985
                          api/specs.pb.go on lines 1012..1023
                          api/specs.pb.go on lines 1053..1064
                          api/specs.pb.go on lines 1116..1127
                          api/specs.pb.go on lines 1202..1213
                          api/specs.pb.go on lines 1249..1260
                          api/specs.pb.go on lines 1296..1307
                          api/specs.pb.go on lines 1373..1384
                          api/watch.pb.go on lines 95..106
                          api/watch.pb.go on lines 275..286
                          api/watch.pb.go on lines 313..324
                          api/watch.pb.go on lines 370..381
                          api/watch.pb.go on lines 633..644
                          api/watch.pb.go on lines 677..688
                          api/watch.pb.go on lines 719..730
                          api/watch.pb.go on lines 764..775
                          protobuf/plugin/plugin.pb.go on lines 58..69
                          protobuf/plugin/plugin.pb.go on lines 94..105
                          protobuf/plugin/plugin.pb.go on lines 135..146

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

                          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

                          type ResourceAllocatorClient interface {
                              AttachNetwork(ctx context.Context, in *AttachNetworkRequest, opts ...grpc.CallOption) (*AttachNetworkResponse, error)
                              DetachNetwork(ctx context.Context, in *DetachNetworkRequest, opts ...grpc.CallOption) (*DetachNetworkResponse, error)
                          }
                          Severity: Minor
                          Found in api/resource.pb.go and 1 other location - About 40 mins to fix
                          api/ca.pb.go on lines 696..699

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

                          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 (c *resourceAllocatorClient) DetachNetwork(ctx context.Context, in *DetachNetworkRequest, opts ...grpc.CallOption) (*DetachNetworkResponse, error) {
                              out := new(DetachNetworkResponse)
                              err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.ResourceAllocator/DetachNetwork", in, out, opts...)
                              if err != nil {
                                  return nil, err
                          Severity: Major
                          Found in api/resource.pb.go and 13 other locations - About 35 mins to fix
                          api/ca.pb.go on lines 599..606
                          api/ca.pb.go on lines 608..615
                          api/ca.pb.go on lines 709..716
                          api/ca.pb.go on lines 718..725
                          api/dispatcher.pb.go on lines 1416..1423
                          api/dispatcher.pb.go on lines 1425..1432
                          api/dispatcher.pb.go on lines 1434..1441
                          api/health.pb.go on lines 245..252
                          api/raft.pb.go on lines 1140..1147
                          api/raft.pb.go on lines 1183..1190
                          api/raft.pb.go on lines 1328..1335
                          api/raft.pb.go on lines 1337..1344
                          api/resource.pb.go on lines 335..342

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

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

                          func encodeVarintResource(dAtA []byte, offset int, v uint64) int {
                              offset -= sovResource(v)
                              base := offset
                              for v >= 1<<7 {
                                  dAtA[offset] = uint8(v&0x7f | 0x80)
                          Severity: Major
                          Found in api/resource.pb.go and 10 other locations - About 35 mins to fix
                          api/ca.pb.go on lines 1076..1086
                          api/dispatcher.pb.go on lines 2431..2441
                          api/health.pb.go on lines 360..370
                          api/logbroker.pb.go on lines 1704..1714
                          api/objects.pb.go on lines 2619..2629
                          api/raft.pb.go on lines 2074..2084
                          api/snapshot.pb.go on lines 616..626
                          api/specs.pb.go on lines 3784..3794
                          api/watch.pb.go on lines 2137..2147
                          protobuf/plugin/plugin.pb.go on lines 526..536

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

                          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 (c *resourceAllocatorClient) AttachNetwork(ctx context.Context, in *AttachNetworkRequest, opts ...grpc.CallOption) (*AttachNetworkResponse, error) {
                              out := new(AttachNetworkResponse)
                              err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.ResourceAllocator/AttachNetwork", in, out, opts...)
                              if err != nil {
                                  return nil, err
                          Severity: Major
                          Found in api/resource.pb.go and 13 other locations - About 35 mins to fix
                          api/ca.pb.go on lines 599..606
                          api/ca.pb.go on lines 608..615
                          api/ca.pb.go on lines 709..716
                          api/ca.pb.go on lines 718..725
                          api/dispatcher.pb.go on lines 1416..1423
                          api/dispatcher.pb.go on lines 1425..1432
                          api/dispatcher.pb.go on lines 1434..1441
                          api/health.pb.go on lines 245..252
                          api/raft.pb.go on lines 1140..1147
                          api/raft.pb.go on lines 1183..1190
                          api/raft.pb.go on lines 1328..1335
                          api/raft.pb.go on lines 1337..1344
                          api/resource.pb.go on lines 344..351

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

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

                          func (m *AttachNetworkResponse) Size() (n int) {
                              if m == nil {
                                  return 0
                              }
                              var l int
                          Severity: Major
                          Found in api/resource.pb.go and 11 other locations - About 30 mins to fix
                          api/ca.pb.go on lines 1372..1383
                          api/ca.pb.go on lines 1450..1461
                          api/dispatcher.pb.go on lines 2823..2834
                          api/dispatcher.pb.go on lines 2936..2947
                          api/dispatcher.pb.go on lines 2964..2975
                          api/health.pb.go on lines 479..490
                          api/raft.pb.go on lines 2449..2460
                          api/raft.pb.go on lines 2563..2574
                          api/resource.pb.go on lines 736..747
                          api/specs.pb.go on lines 4054..4065
                          api/specs.pb.go on lines 4217..4228

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

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

                          func (m *DetachNetworkRequest) Size() (n int) {
                              if m == nil {
                                  return 0
                              }
                              var l int
                          Severity: Major
                          Found in api/resource.pb.go and 11 other locations - About 30 mins to fix
                          api/ca.pb.go on lines 1372..1383
                          api/ca.pb.go on lines 1450..1461
                          api/dispatcher.pb.go on lines 2823..2834
                          api/dispatcher.pb.go on lines 2936..2947
                          api/dispatcher.pb.go on lines 2964..2975
                          api/health.pb.go on lines 479..490
                          api/raft.pb.go on lines 2449..2460
                          api/raft.pb.go on lines 2563..2574
                          api/resource.pb.go on lines 723..734
                          api/specs.pb.go on lines 4054..4065
                          api/specs.pb.go on lines 4217..4228

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

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

                          func (p *authenticatedWrapperResourceAllocatorServer) DetachNetwork(ctx context.Context, r *DetachNetworkRequest) (*DetachNetworkResponse, error) {
                          
                              if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil {
                                  return nil, err
                              }
                          Severity: Major
                          Found in api/resource.pb.go and 4 other locations - About 30 mins to fix
                          api/dispatcher.pb.go on lines 961..967
                          api/dispatcher.pb.go on lines 969..975
                          api/dispatcher.pb.go on lines 977..983
                          api/resource.pb.go on lines 235..241

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

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

                          func (p *authenticatedWrapperResourceAllocatorServer) AttachNetwork(ctx context.Context, r *AttachNetworkRequest) (*AttachNetworkResponse, error) {
                          
                              if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil {
                                  return nil, err
                              }
                          Severity: Major
                          Found in api/resource.pb.go and 4 other locations - About 30 mins to fix
                          api/dispatcher.pb.go on lines 961..967
                          api/dispatcher.pb.go on lines 969..975
                          api/dispatcher.pb.go on lines 977..983
                          api/resource.pb.go on lines 243..249

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

                          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

                          There are no issues that match your filters.

                          Category
                          Status