docker/swarmkit

View on GitHub
api/ca.pb.go

Summary

Maintainability
F
1 mo
Test Coverage

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

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

package api

Severity: Major
Found in api/ca.pb.go - About 5 days to fix

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

    func (m *IssueNodeCertificateRequest) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/ca.pb.go - About 2 days 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 NodeCertificateStatusResponse.Unmarshal has a Cognitive Complexity of 95 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *NodeCertificateStatusResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/ca.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 GetUnlockKeyResponse.Unmarshal has a Cognitive Complexity of 89 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/ca.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 IssueNodeCertificateResponse.Unmarshal has a Cognitive Complexity of 74 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *IssueNodeCertificateResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/ca.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 GetRootCACertificateResponse.Unmarshal has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *GetRootCACertificateResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/ca.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 NodeCertificateStatusRequest.Unmarshal has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *NodeCertificateStatusRequest) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Minor
    Found in api/ca.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 skipCa has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
    Open

    func skipCa(dAtA []byte) (n int, err error) {
        l := len(dAtA)
        iNdEx := 0
        depth := 0
        for iNdEx < l {
    Severity: Minor
    Found in api/ca.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 IssueNodeCertificateRequest.Unmarshal has 151 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

      Method NodeCertificateStatusResponse.Unmarshal has 119 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

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

        Method GetUnlockKeyResponse.Unmarshal has 114 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

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

          Method IssueNodeCertificateResponse.Unmarshal has 98 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

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

            Method IssueNodeCertificateRequest.Unmarshal has 27 return statements (exceeds 4 allowed).
            Open

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

              Method GetRootCACertificateResponse.Unmarshal has 81 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

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

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

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

                  Method NodeCertificateStatusResponse.Unmarshal has 23 return statements (exceeds 4 allowed).
                  Open

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

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

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

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

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

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

                        func (m *GetUnlockKeyRequest) Unmarshal(dAtA []byte) error {
                            l := len(dAtA)
                            iNdEx := 0
                            for iNdEx < l {
                                preIndex := iNdEx
                        Severity: Minor
                        Found in api/ca.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 GetRootCACertificateRequest.Unmarshal has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func (m *GetRootCACertificateRequest) Unmarshal(dAtA []byte) error {
                            l := len(dAtA)
                            iNdEx := 0
                            for iNdEx < l {
                                preIndex := iNdEx
                        Severity: Minor
                        Found in api/ca.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 IssueNodeCertificateResponse.Unmarshal has 18 return statements (exceeds 4 allowed).
                        Open

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

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

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

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

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

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

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

                                Method raftProxyCAServer.GetRootCACertificate has 9 return statements (exceeds 4 allowed).
                                Open

                                func (p *raftProxyCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) {
                                
                                    conn, err := p.connSelector.LeaderConn(ctx)
                                    if err != nil {
                                        if err == raftselector.ErrIsLeader {
                                Severity: Major
                                Found in api/ca.pb.go - About 55 mins to fix

                                  Method raftProxyNodeCAServer.NodeCertificateStatus has 9 return statements (exceeds 4 allowed).
                                  Open

                                  func (p *raftProxyNodeCAServer) NodeCertificateStatus(ctx context.Context, r *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) {
                                  
                                      conn, err := p.connSelector.LeaderConn(ctx)
                                      if err != nil {
                                          if err == raftselector.ErrIsLeader {
                                  Severity: Major
                                  Found in api/ca.pb.go - About 55 mins to fix

                                    Method raftProxyCAServer.GetUnlockKey has 9 return statements (exceeds 4 allowed).
                                    Open

                                    func (p *raftProxyCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) {
                                    
                                        conn, err := p.connSelector.LeaderConn(ctx)
                                        if err != nil {
                                            if err == raftselector.ErrIsLeader {
                                    Severity: Major
                                    Found in api/ca.pb.go - About 55 mins to fix

                                      Method raftProxyNodeCAServer.IssueNodeCertificate has 9 return statements (exceeds 4 allowed).
                                      Open

                                      func (p *raftProxyNodeCAServer) IssueNodeCertificate(ctx context.Context, r *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) {
                                      
                                          conn, err := p.connSelector.LeaderConn(ctx)
                                          if err != nil {
                                              if err == raftselector.ErrIsLeader {
                                      Severity: Major
                                      Found in api/ca.pb.go - About 55 mins to fix

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

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

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

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

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

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

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

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            func (m *IssueNodeCertificateResponse) Unmarshal(dAtA []byte) error {
                                                l := len(dAtA)
                                                iNdEx := 0
                                                for iNdEx < l {
                                                    preIndex := iNdEx
                                            Severity: Major
                                            Found in api/ca.pb.go and 2 other locations - About 1 day to fix
                                            api/specs.pb.go on lines 6061..6161
                                            api/watch.pb.go on lines 3478..3578

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

                                            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 *NodeCertificateStatusRequest) Unmarshal(dAtA []byte) error {
                                                l := len(dAtA)
                                                iNdEx := 0
                                                for iNdEx < l {
                                                    preIndex := iNdEx
                                            Severity: Major
                                            Found in api/ca.pb.go and 10 other locations - About 1 day to fix
                                            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/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 skipCa(dAtA []byte) (n int, err error) {
                                                l := len(dAtA)
                                                iNdEx := 0
                                                depth := 0
                                                for iNdEx < l {
                                            Severity: Major
                                            Found in api/ca.pb.go and 10 other locations - About 6 hrs to fix
                                            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/resource.pb.go on lines 1144..1221
                                            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 NewRaftProxyNodeCAServer(local NodeCAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) NodeCAServer {
                                                redirectChecker := func(ctx context.Context) (context.Context, error) {
                                                    p, ok := peer.FromContext(ctx)
                                                    if !ok {
                                                        return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
                                            Severity: Major
                                            Found in api/ca.pb.go and 9 other locations - About 5 hrs to fix
                                            api/ca.pb.go on lines 1094..1125
                                            api/dispatcher.pb.go on lines 2449..2480
                                            api/health.pb.go on lines 378..409
                                            api/logbroker.pb.go on lines 1722..1753
                                            api/logbroker.pb.go on lines 1845..1876
                                            api/raft.pb.go on lines 2092..2123
                                            api/raft.pb.go on lines 2291..2322
                                            api/resource.pb.go on lines 570..601
                                            api/watch.pb.go on lines 2155..2186

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 415.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 415.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 352.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 352.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            func (p *raftProxyCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) {
                                            
                                                conn, err := p.connSelector.LeaderConn(ctx)
                                                if err != nil {
                                                    if err == raftselector.ErrIsLeader {
                                            Severity: Major
                                            Found in api/ca.pb.go and 13 other locations - About 4 hrs to fix
                                            api/ca.pb.go on lines 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
                                            api/resource.pb.go on lines 671..704

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 352.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            func (p *raftProxyCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) {
                                            
                                                conn, err := p.connSelector.LeaderConn(ctx)
                                                if err != nil {
                                                    if err == raftselector.ErrIsLeader {
                                            Severity: Major
                                            Found in api/ca.pb.go and 13 other locations - About 4 hrs to fix
                                            api/ca.pb.go on lines 1160..1193
                                            api/ca.pb.go on lines 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
                                            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 *GetUnlockKeyRequest) Unmarshal(dAtA []byte) error {
                                                l := len(dAtA)
                                                iNdEx := 0
                                                for iNdEx < l {
                                                    preIndex := iNdEx
                                            Severity: Major
                                            Found in api/ca.pb.go and 11 other locations - About 4 hrs to fix
                                            api/ca.pb.go on lines 2044..2093
                                            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/resource.pb.go on lines 1094..1143
                                            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 12 locations. Consider refactoring.
                                            Open

                                            func (m *GetRootCACertificateRequest) Unmarshal(dAtA []byte) error {
                                                l := len(dAtA)
                                                iNdEx := 0
                                                for iNdEx < l {
                                                    preIndex := iNdEx
                                            Severity: Major
                                            Found in api/ca.pb.go and 11 other locations - About 4 hrs to fix
                                            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/resource.pb.go on lines 1094..1143
                                            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 *NodeCertificateStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                                                i := len(dAtA)
                                                _ = i
                                                var l int
                                                _ = l
                                            Severity: Major
                                            Found in api/ca.pb.go and 1 other location - About 2 hrs to fix
                                            api/logbroker.pb.go on lines 1471..1501

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

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

                                                    case 1:
                                                        if wireType != 2 {
                                                            return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType)
                                                        }
                                                        var byteLen int
                                            Severity: Major
                                            Found in api/ca.pb.go and 6 other locations - About 2 hrs to fix
                                            api/ca.pb.go on lines 1837..1870
                                            api/ca.pb.go on lines 2257..2290
                                            api/dispatcher.pb.go on lines 3617..3650
                                            api/logbroker.pb.go on lines 3104..3137
                                            api/specs.pb.go on lines 8594..8627
                                            api/specs.pb.go on lines 8783..8816

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

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

                                                    case 1:
                                                        if wireType != 2 {
                                                            return fmt.Errorf("proto: wrong wireType = %d for field UnlockKey", wireType)
                                                        }
                                                        var byteLen int
                                            Severity: Major
                                            Found in api/ca.pb.go and 6 other locations - About 2 hrs to fix
                                            api/ca.pb.go on lines 1837..1870
                                            api/ca.pb.go on lines 2123..2156
                                            api/dispatcher.pb.go on lines 3617..3650
                                            api/logbroker.pb.go on lines 3104..3137
                                            api/specs.pb.go on lines 8594..8627
                                            api/specs.pb.go on lines 8783..8816

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

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

                                                    case 2:
                                                        if wireType != 2 {
                                                            return fmt.Errorf("proto: wrong wireType = %d for field CSR", wireType)
                                                        }
                                                        var byteLen int
                                            Severity: Major
                                            Found in api/ca.pb.go and 6 other locations - About 2 hrs to fix
                                            api/ca.pb.go on lines 2123..2156
                                            api/ca.pb.go on lines 2257..2290
                                            api/dispatcher.pb.go on lines 3617..3650
                                            api/logbroker.pb.go on lines 3104..3137
                                            api/specs.pb.go on lines 8594..8627
                                            api/specs.pb.go on lines 8783..8816

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

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 221.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 221.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 221.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 221.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                    case 2:
                                                        if wireType != 2 {
                                                            return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
                                                        }
                                                        var msglen int
                                            Severity: Major
                                            Found in api/ca.pb.go and 46 other locations - About 2 hrs to fix
                                            api/logbroker.pb.go on lines 3016..3048
                                            api/objects.pb.go on lines 6328..6360
                                            api/objects.pb.go on lines 6515..6547
                                            api/objects.pb.go on lines 6548..6580
                                            api/objects.pb.go on lines 6617..6649
                                            api/objects.pb.go on lines 6722..6754
                                            api/objects.pb.go on lines 6909..6941
                                            api/objects.pb.go on lines 6942..6974
                                            api/objects.pb.go on lines 7561..7593
                                            api/objects.pb.go on lines 7594..7626
                                            api/objects.pb.go on lines 7710..7742
                                            api/objects.pb.go on lines 7743..7775
                                            api/objects.pb.go on lines 7776..7808
                                            api/objects.pb.go on lines 8433..8465
                                            api/objects.pb.go on lines 8466..8498
                                            api/objects.pb.go on lines 8673..8705
                                            api/objects.pb.go on lines 8706..8738
                                            api/objects.pb.go on lines 8739..8771
                                            api/objects.pb.go on lines 9160..9192
                                            api/objects.pb.go on lines 9193..9225
                                            api/objects.pb.go on lines 9328..9360
                                            api/objects.pb.go on lines 9361..9393
                                            api/objects.pb.go on lines 9476..9508
                                            api/objects.pb.go on lines 9509..9541
                                            api/objects.pb.go on lines 9692..9724
                                            api/objects.pb.go on lines 9725..9757
                                            api/objects.pb.go on lines 9872..9904
                                            api/objects.pb.go on lines 9905..9937
                                            api/raft.pb.go on lines 3100..3132
                                            api/snapshot.pb.go on lines 1441..1473
                                            api/snapshot.pb.go on lines 1474..1506
                                            api/specs.pb.go on lines 4909..4941
                                            api/specs.pb.go on lines 5049..5081
                                            api/specs.pb.go on lines 5082..5114
                                            api/specs.pb.go on lines 7980..8012
                                            api/specs.pb.go on lines 8247..8279
                                            api/specs.pb.go on lines 8280..8312
                                            api/specs.pb.go on lines 8313..8345
                                            api/specs.pb.go on lines 8346..8378
                                            api/specs.pb.go on lines 8379..8411
                                            api/specs.pb.go on lines 8412..8444
                                            api/specs.pb.go on lines 8445..8477
                                            api/specs.pb.go on lines 8478..8510
                                            api/specs.pb.go on lines 8561..8593
                                            api/specs.pb.go on lines 8750..8782
                                            api/specs.pb.go on lines 8903..8935

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

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            func (p *raftProxyCAServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
                                                ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
                                                defer ticker.Stop()
                                                for {
                                                    select {
                                            Severity: Major
                                            Found in api/ca.pb.go and 9 other locations - About 2 hrs to fix
                                            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/resource.pb.go on lines 612..634
                                            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 10 locations. Consider refactoring.
                                            Open

                                            func (p *raftProxyNodeCAServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
                                                ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
                                                defer ticker.Stop()
                                                for {
                                                    select {
                                            Severity: Major
                                            Found in api/ca.pb.go and 9 other locations - About 2 hrs to fix
                                            api/ca.pb.go on lines 1136..1158
                                            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/resource.pb.go on lines 612..634
                                            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 3 locations. Consider refactoring.
                                            Open

                                            func (m *IssueNodeCertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                                                i := len(dAtA)
                                                _ = i
                                                var l int
                                                _ = l
                                            Severity: Major
                                            Found in api/ca.pb.go and 2 other locations - About 2 hrs to fix
                                            api/specs.pb.go on lines 2727..2745
                                            api/watch.pb.go on lines 1591..1609

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

                                            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 *GetRootCACertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                                                i := len(dAtA)
                                                _ = i
                                                var l int
                                                _ = l
                                            Severity: Major
                                            Found in api/ca.pb.go and 10 other locations - About 1 hr to fix
                                            api/ca.pb.go on lines 816..829
                                            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/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 11 locations. Consider refactoring.
                                            Open

                                            func (m *NodeCertificateStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                                                i := len(dAtA)
                                                _ = i
                                                var l int
                                                _ = l
                                            Severity: Major
                                            Found in api/ca.pb.go and 10 other locations - About 1 hr to fix
                                            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/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 *NodeCertificateStatusResponse) Size() (n int) {
                                                if m == nil {
                                                    return 0
                                                }
                                                var l int
                                            Severity: Major
                                            Found in api/ca.pb.go and 1 other location - About 1 hr to fix
                                            api/logbroker.pb.go on lines 2136..2151

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

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

                                            func (m *NodeCertificateStatusResponse) CopyFrom(src interface{}) {
                                            
                                                o := src.(*NodeCertificateStatusResponse)
                                                *m = *o
                                                if o.Status != nil {
                                            Severity: Major
                                            Found in api/ca.pb.go and 3 other locations - About 1 hr to fix
                                            api/logbroker.pb.go on lines 793..805
                                            api/logbroker.pb.go on lines 848..860
                                            api/watch.pb.go on lines 1203..1215

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

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            func (m *IssueNodeCertificateResponse) Size() (n int) {
                                                if m == nil {
                                                    return 0
                                                }
                                                var l int
                                            Severity: Major
                                            Found in api/ca.pb.go and 2 other locations - About 1 hr to fix
                                            api/specs.pb.go on lines 4021..4035
                                            api/watch.pb.go on lines 2404..2418

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 120.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 120.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            func (m *GetRootCACertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_GetRootCACertificateResponse.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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 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/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 *GetRootCACertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_GetRootCACertificateRequest.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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 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/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 *IssueNodeCertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_IssueNodeCertificateRequest.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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 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/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 *IssueNodeCertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_IssueNodeCertificateResponse.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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 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/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 *GetUnlockKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_GetUnlockKeyResponse.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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/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/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 *NodeCertificateStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_NodeCertificateStatusRequest.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.pb.go and 101 other locations - About 45 mins to fix
                                            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/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 *NodeCertificateStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_NodeCertificateStatusResponse.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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 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/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 *GetUnlockKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                                                if deterministic {
                                                    return xxx_messageInfo_GetUnlockKeyRequest.Marshal(b, m, deterministic)
                                                } else {
                                                    b = b[:cap(b)]
                                            Severity: Major
                                            Found in api/ca.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 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/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 2 locations. Consider refactoring.
                                            Open

                                            type NodeCAClient interface {
                                                IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error)
                                                NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error)
                                            }
                                            Severity: Minor
                                            Found in api/ca.pb.go and 1 other location - About 40 mins to fix
                                            api/resource.pb.go on lines 322..325

                                            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 *nodeCAClient) NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error) {
                                                out := new(NodeCertificateStatusResponse)
                                                err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/NodeCertificateStatus", in, out, opts...)
                                                if err != nil {
                                                    return nil, err
                                            Severity: Major
                                            Found in api/ca.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/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
                                            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 14 locations. Consider refactoring.
                                            Open

                                            func (c *nodeCAClient) IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error) {
                                                out := new(IssueNodeCertificateResponse)
                                                err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/IssueNodeCertificate", in, out, opts...)
                                                if err != nil {
                                                    return nil, err
                                            Severity: Major
                                            Found in api/ca.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 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
                                            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 14 locations. Consider refactoring.
                                            Open

                                            func (c *cAClient) GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error) {
                                                out := new(GetRootCACertificateResponse)
                                                err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetRootCACertificate", in, out, opts...)
                                                if err != nil {
                                                    return nil, err
                                            Severity: Major
                                            Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
                                            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
                                            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 8 locations. Consider refactoring.
                                            Open

                                            func (this *IssueNodeCertificateResponse) String() string {
                                                if this == nil {
                                                    return "nil"
                                                }
                                                s := strings.Join([]string{`&IssueNodeCertificateResponse{`,
                                            Severity: Major
                                            Found in api/ca.pb.go and 7 other locations - About 35 mins to fix
                                            api/dispatcher.pb.go on lines 3192..3202
                                            api/logbroker.pb.go on lines 2275..2285
                                            api/objects.pb.go on lines 6088..6098
                                            api/raft.pb.go on lines 2869..2879
                                            api/specs.pb.go on lines 4544..4554
                                            api/specs.pb.go on lines 4621..4631
                                            api/watch.pb.go on lines 2815..2825

                                            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 *cAClient) GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error) {
                                                out := new(GetUnlockKeyResponse)
                                                err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetUnlockKey", in, out, opts...)
                                                if err != nil {
                                                    return nil, err
                                            Severity: Major
                                            Found in api/ca.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 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
                                            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 11 locations. Consider refactoring.
                                            Open

                                            func encodeVarintCa(dAtA []byte, offset int, v uint64) int {
                                                offset -= sovCa(v)
                                                base := offset
                                                for v >= 1<<7 {
                                                    dAtA[offset] = uint8(v&0x7f | 0x80)
                                            Severity: Major
                                            Found in api/ca.pb.go and 10 other locations - About 35 mins to fix
                                            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/resource.pb.go on lines 552..562
                                            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 3 locations. Consider refactoring.
                                            Open

                                            func (m *GetRootCACertificateResponse) CopyFrom(src interface{}) {
                                            
                                                o := src.(*GetRootCACertificateResponse)
                                                *m = *o
                                                if o.Certificate != nil {
                                            Severity: Minor
                                            Found in api/ca.pb.go and 2 other locations - About 30 mins to fix
                                            api/ca.pb.go on lines 489..497
                                            protobuf/plugin/plugin.pb.go on lines 283..292

                                            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 *NodeCertificateStatusRequest) Size() (n int) {
                                                if m == nil {
                                                    return 0
                                                }
                                                var l int
                                            Severity: Major
                                            Found in api/ca.pb.go and 11 other locations - About 30 mins to fix
                                            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/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 *GetRootCACertificateResponse) Size() (n int) {
                                                if m == nil {
                                                    return 0
                                                }
                                                var l int
                                            Severity: Major
                                            Found in api/ca.pb.go and 11 other locations - About 30 mins to fix
                                            api/ca.pb.go on lines 1372..1383
                                            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/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 3 locations. Consider refactoring.
                                            Open

                                            func (m *IssueNodeCertificateRequest) CopyFrom(src interface{}) {
                                            
                                                o := src.(*IssueNodeCertificateRequest)
                                                *m = *o
                                                if o.CSR != nil {
                                            Severity: Minor
                                            Found in api/ca.pb.go and 2 other locations - About 30 mins to fix
                                            api/ca.pb.go on lines 533..541
                                            protobuf/plugin/plugin.pb.go on lines 283..292

                                            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

                                            There are no issues that match your filters.

                                            Category
                                            Status