docker/swarmkit

View on GitHub
protobuf/plugin/plugin.pb.go

Summary

Maintainability
F
2 wks
Test Coverage

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

func (m *WatchSelectors) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Minor
Found in protobuf/plugin/plugin.pb.go - About 5 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

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

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

package plugin

Severity: Major
Found in protobuf/plugin/plugin.pb.go - About 2 days to fix

    Method WatchSelectors.Unmarshal has 320 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

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

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

      func (m *StoreObject) Unmarshal(dAtA []byte) error {
          var hasFields [1]uint64
          l := len(dAtA)
          iNdEx := 0
          for iNdEx < l {
      Severity: Minor
      Found in protobuf/plugin/plugin.pb.go - About 7 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 skipPlugin has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
      Open

      func skipPlugin(dAtA []byte) (n int, err error) {
          l := len(dAtA)
          iNdEx := 0
          depth := 0
          for iNdEx < l {
      Severity: Minor
      Found in protobuf/plugin/plugin.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 WatchSelectors.MarshalToSizedBuffer has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
      Open

      func (m *WatchSelectors) MarshalToSizedBuffer(dAtA []byte) (int, error) {
          i := len(dAtA)
          _ = i
          var l int
          _ = l
      Severity: Minor
      Found in protobuf/plugin/plugin.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 WatchSelectors.MarshalToSizedBuffer has 135 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

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

        Method WatchSelectors.Unmarshal has 48 return statements (exceeds 4 allowed).
        Open

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

          Method TLSAuthorization.Unmarshal has 100 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

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

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

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

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

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

                Method TLSAuthorization.Unmarshal has 18 return statements (exceeds 4 allowed).
                Open

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

                  Method StoreObject.Unmarshal has 17 return statements (exceeds 4 allowed).
                  Open

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

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

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

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

                      func skipPlugin(dAtA []byte) (n int, err error) {
                          l := len(dAtA)
                          iNdEx := 0
                          depth := 0
                          for iNdEx < l {
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 10 other locations - About 6 hrs to fix
                      api/ca.pb.go on lines 2345..2422
                      api/dispatcher.pb.go on lines 5099..5176
                      api/health.pb.go on lines 689..766
                      api/logbroker.pb.go on lines 3809..3886
                      api/objects.pb.go on lines 10049..10126
                      api/raft.pb.go on lines 4496..4573
                      api/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

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

                              case 9:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 2:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974

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

                      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

                              case 7:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 10:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 3:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 1:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 12:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 11:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 6:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field CustomPrefix", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 8:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 13:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 2:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 4:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 786..806
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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

                              case 5:
                                  if wireType != 0 {
                                      return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType)
                                  }
                                  var v int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 13 other locations - About 1 hr to fix
                      protobuf/plugin/plugin.pb.go on lines 702..722
                      protobuf/plugin/plugin.pb.go on lines 723..743
                      protobuf/plugin/plugin.pb.go on lines 744..764
                      protobuf/plugin/plugin.pb.go on lines 765..785
                      protobuf/plugin/plugin.pb.go on lines 807..827
                      protobuf/plugin/plugin.pb.go on lines 828..848
                      protobuf/plugin/plugin.pb.go on lines 849..869
                      protobuf/plugin/plugin.pb.go on lines 870..890
                      protobuf/plugin/plugin.pb.go on lines 891..911
                      protobuf/plugin/plugin.pb.go on lines 912..932
                      protobuf/plugin/plugin.pb.go on lines 933..953
                      protobuf/plugin/plugin.pb.go on lines 954..974
                      protobuf/plugin/plugin.pb.go on lines 1148..1168

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

                      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 *StoreObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                          if deterministic {
                              return xxx_messageInfo_StoreObject.Marshal(b, m, deterministic)
                          } else {
                              b = b[:cap(b)]
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 101 other locations - About 45 mins to fix
                      api/ca.pb.go on lines 50..61
                      api/ca.pb.go on lines 87..98
                      api/ca.pb.go on lines 131..142
                      api/ca.pb.go on lines 168..179
                      api/ca.pb.go on lines 203..214
                      api/ca.pb.go on lines 239..250
                      api/ca.pb.go on lines 274..285
                      api/ca.pb.go on lines 311..322
                      api/dispatcher.pb.go on lines 112..123
                      api/dispatcher.pb.go on lines 202..213
                      api/dispatcher.pb.go on lines 239..250
                      api/dispatcher.pb.go on lines 277..288
                      api/dispatcher.pb.go on lines 316..327
                      api/dispatcher.pb.go on lines 355..366
                      api/dispatcher.pb.go on lines 390..401
                      api/dispatcher.pb.go on lines 427..438
                      api/dispatcher.pb.go on lines 476..487
                      api/dispatcher.pb.go on lines 511..522
                      api/dispatcher.pb.go on lines 547..558
                      api/dispatcher.pb.go on lines 585..596
                      api/dispatcher.pb.go on lines 621..632
                      api/dispatcher.pb.go on lines 662..673
                      api/dispatcher.pb.go on lines 768..779
                      api/dispatcher.pb.go on lines 816..827
                      api/health.pb.go on lines 77..88
                      api/health.pb.go on lines 113..124
                      api/logbroker.pb.go on lines 105..116
                      api/logbroker.pb.go on lines 148..159
                      api/logbroker.pb.go on lines 187..198
                      api/logbroker.pb.go on lines 225..236
                      api/logbroker.pb.go on lines 273..284
                      api/logbroker.pb.go on lines 311..322
                      api/logbroker.pb.go on lines 347..358
                      api/logbroker.pb.go on lines 384..395
                      api/logbroker.pb.go on lines 432..443
                      api/logbroker.pb.go on lines 477..488
                      api/logbroker.pb.go on lines 512..523
                      api/objects.pb.go on lines 51..62
                      api/objects.pb.go on lines 123..134
                      api/objects.pb.go on lines 190..201
                      api/objects.pb.go on lines 235..246
                      api/objects.pb.go on lines 283..294
                      api/objects.pb.go on lines 382..393
                      api/objects.pb.go on lines 430..441
                      api/objects.pb.go on lines 486..497
                      api/objects.pb.go on lines 558..569
                      api/objects.pb.go on lines 602..613
                      api/objects.pb.go on lines 644..655
                      api/objects.pb.go on lines 692..703
                      api/objects.pb.go on lines 733..744
                      api/objects.pb.go on lines 790..801
                      api/raft.pb.go on lines 90..101
                      api/raft.pb.go on lines 127..138
                      api/raft.pb.go on lines 169..180
                      api/raft.pb.go on lines 205..216
                      api/raft.pb.go on lines 240..251
                      api/raft.pb.go on lines 276..287
                      api/raft.pb.go on lines 311..322
                      api/raft.pb.go on lines 348..359
                      api/raft.pb.go on lines 384..395
                      api/raft.pb.go on lines 421..432
                      api/raft.pb.go on lines 458..469
                      api/raft.pb.go on lines 498..509
                      api/raft.pb.go on lines 547..558
                      api/resource.pb.go on lines 51..62
                      api/resource.pb.go on lines 87..98
                      api/resource.pb.go on lines 123..134
                      api/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 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 *WatchSelectors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                          if deterministic {
                              return xxx_messageInfo_WatchSelectors.Marshal(b, m, deterministic)
                          } else {
                              b = b[:cap(b)]
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 101 other locations - About 45 mins to fix
                      api/ca.pb.go on lines 50..61
                      api/ca.pb.go on lines 87..98
                      api/ca.pb.go on lines 131..142
                      api/ca.pb.go on lines 168..179
                      api/ca.pb.go on lines 203..214
                      api/ca.pb.go on lines 239..250
                      api/ca.pb.go on lines 274..285
                      api/ca.pb.go on lines 311..322
                      api/dispatcher.pb.go on lines 112..123
                      api/dispatcher.pb.go on lines 202..213
                      api/dispatcher.pb.go on lines 239..250
                      api/dispatcher.pb.go on lines 277..288
                      api/dispatcher.pb.go on lines 316..327
                      api/dispatcher.pb.go on lines 355..366
                      api/dispatcher.pb.go on lines 390..401
                      api/dispatcher.pb.go on lines 427..438
                      api/dispatcher.pb.go on lines 476..487
                      api/dispatcher.pb.go on lines 511..522
                      api/dispatcher.pb.go on lines 547..558
                      api/dispatcher.pb.go on lines 585..596
                      api/dispatcher.pb.go on lines 621..632
                      api/dispatcher.pb.go on lines 662..673
                      api/dispatcher.pb.go on lines 768..779
                      api/dispatcher.pb.go on lines 816..827
                      api/health.pb.go on lines 77..88
                      api/health.pb.go on lines 113..124
                      api/logbroker.pb.go on lines 105..116
                      api/logbroker.pb.go on lines 148..159
                      api/logbroker.pb.go on lines 187..198
                      api/logbroker.pb.go on lines 225..236
                      api/logbroker.pb.go on lines 273..284
                      api/logbroker.pb.go on lines 311..322
                      api/logbroker.pb.go on lines 347..358
                      api/logbroker.pb.go on lines 384..395
                      api/logbroker.pb.go on lines 432..443
                      api/logbroker.pb.go on lines 477..488
                      api/logbroker.pb.go on lines 512..523
                      api/objects.pb.go on lines 51..62
                      api/objects.pb.go on lines 123..134
                      api/objects.pb.go on lines 190..201
                      api/objects.pb.go on lines 235..246
                      api/objects.pb.go on lines 283..294
                      api/objects.pb.go on lines 382..393
                      api/objects.pb.go on lines 430..441
                      api/objects.pb.go on lines 486..497
                      api/objects.pb.go on lines 558..569
                      api/objects.pb.go on lines 602..613
                      api/objects.pb.go on lines 644..655
                      api/objects.pb.go on lines 692..703
                      api/objects.pb.go on lines 733..744
                      api/objects.pb.go on lines 790..801
                      api/raft.pb.go on lines 90..101
                      api/raft.pb.go on lines 127..138
                      api/raft.pb.go on lines 169..180
                      api/raft.pb.go on lines 205..216
                      api/raft.pb.go on lines 240..251
                      api/raft.pb.go on lines 276..287
                      api/raft.pb.go on lines 311..322
                      api/raft.pb.go on lines 348..359
                      api/raft.pb.go on lines 384..395
                      api/raft.pb.go on lines 421..432
                      api/raft.pb.go on lines 458..469
                      api/raft.pb.go on lines 498..509
                      api/raft.pb.go on lines 547..558
                      api/resource.pb.go on lines 51..62
                      api/resource.pb.go on lines 87..98
                      api/resource.pb.go on lines 123..134
                      api/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 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 *TLSAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
                          if deterministic {
                              return xxx_messageInfo_TLSAuthorization.Marshal(b, m, deterministic)
                          } else {
                              b = b[:cap(b)]
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 101 other locations - About 45 mins to fix
                      api/ca.pb.go on lines 50..61
                      api/ca.pb.go on lines 87..98
                      api/ca.pb.go on lines 131..142
                      api/ca.pb.go on lines 168..179
                      api/ca.pb.go on lines 203..214
                      api/ca.pb.go on lines 239..250
                      api/ca.pb.go on lines 274..285
                      api/ca.pb.go on lines 311..322
                      api/dispatcher.pb.go on lines 112..123
                      api/dispatcher.pb.go on lines 202..213
                      api/dispatcher.pb.go on lines 239..250
                      api/dispatcher.pb.go on lines 277..288
                      api/dispatcher.pb.go on lines 316..327
                      api/dispatcher.pb.go on lines 355..366
                      api/dispatcher.pb.go on lines 390..401
                      api/dispatcher.pb.go on lines 427..438
                      api/dispatcher.pb.go on lines 476..487
                      api/dispatcher.pb.go on lines 511..522
                      api/dispatcher.pb.go on lines 547..558
                      api/dispatcher.pb.go on lines 585..596
                      api/dispatcher.pb.go on lines 621..632
                      api/dispatcher.pb.go on lines 662..673
                      api/dispatcher.pb.go on lines 768..779
                      api/dispatcher.pb.go on lines 816..827
                      api/health.pb.go on lines 77..88
                      api/health.pb.go on lines 113..124
                      api/logbroker.pb.go on lines 105..116
                      api/logbroker.pb.go on lines 148..159
                      api/logbroker.pb.go on lines 187..198
                      api/logbroker.pb.go on lines 225..236
                      api/logbroker.pb.go on lines 273..284
                      api/logbroker.pb.go on lines 311..322
                      api/logbroker.pb.go on lines 347..358
                      api/logbroker.pb.go on lines 384..395
                      api/logbroker.pb.go on lines 432..443
                      api/logbroker.pb.go on lines 477..488
                      api/logbroker.pb.go on lines 512..523
                      api/objects.pb.go on lines 51..62
                      api/objects.pb.go on lines 123..134
                      api/objects.pb.go on lines 190..201
                      api/objects.pb.go on lines 235..246
                      api/objects.pb.go on lines 283..294
                      api/objects.pb.go on lines 382..393
                      api/objects.pb.go on lines 430..441
                      api/objects.pb.go on lines 486..497
                      api/objects.pb.go on lines 558..569
                      api/objects.pb.go on lines 602..613
                      api/objects.pb.go on lines 644..655
                      api/objects.pb.go on lines 692..703
                      api/objects.pb.go on lines 733..744
                      api/objects.pb.go on lines 790..801
                      api/raft.pb.go on lines 90..101
                      api/raft.pb.go on lines 127..138
                      api/raft.pb.go on lines 169..180
                      api/raft.pb.go on lines 205..216
                      api/raft.pb.go on lines 240..251
                      api/raft.pb.go on lines 276..287
                      api/raft.pb.go on lines 311..322
                      api/raft.pb.go on lines 348..359
                      api/raft.pb.go on lines 384..395
                      api/raft.pb.go on lines 421..432
                      api/raft.pb.go on lines 458..469
                      api/raft.pb.go on lines 498..509
                      api/raft.pb.go on lines 547..558
                      api/resource.pb.go on lines 51..62
                      api/resource.pb.go on lines 87..98
                      api/resource.pb.go on lines 123..134
                      api/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

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

                      func (m *StoreObject) Size() (n int) {
                          if m == nil {
                              return 0
                          }
                          var l int
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 37 other locations - About 40 mins to fix
                      api/dispatcher.pb.go on lines 2989..3000
                      api/dispatcher.pb.go on lines 3001..3012
                      api/dispatcher.pb.go on lines 3013..3024
                      api/dispatcher.pb.go on lines 3025..3036
                      api/raft.pb.go on lines 2485..2496
                      api/raft.pb.go on lines 2507..2518
                      api/raft.pb.go on lines 2529..2540
                      api/raft.pb.go on lines 2609..2620
                      api/raft.pb.go on lines 2621..2632
                      api/raft.pb.go on lines 2633..2644
                      api/raft.pb.go on lines 2645..2656
                      api/raft.pb.go on lines 2657..2668
                      api/raft.pb.go on lines 2669..2680
                      api/raft.pb.go on lines 2681..2692
                      api/raft.pb.go on lines 2693..2704
                      api/raft.pb.go on lines 2705..2716
                      api/raft.pb.go on lines 2717..2728
                      api/specs.pb.go on lines 3849..3860
                      api/specs.pb.go on lines 3861..3872
                      api/specs.pb.go on lines 3873..3884
                      api/specs.pb.go on lines 3885..3896
                      api/specs.pb.go on lines 3985..3996
                      api/specs.pb.go on lines 3997..4008
                      api/specs.pb.go on lines 4009..4020
                      api/watch.pb.go on lines 2284..2295
                      api/watch.pb.go on lines 2296..2307
                      api/watch.pb.go on lines 2308..2319
                      api/watch.pb.go on lines 2320..2331
                      api/watch.pb.go on lines 2332..2343
                      api/watch.pb.go on lines 2344..2355
                      api/watch.pb.go on lines 2356..2367
                      api/watch.pb.go on lines 2368..2379
                      api/watch.pb.go on lines 2380..2391
                      api/watch.pb.go on lines 2392..2403
                      api/watch.pb.go on lines 2493..2504
                      api/watch.pb.go on lines 2505..2516
                      api/watch.pb.go on lines 2537..2548

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

                      func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int {
                          offset -= sovPlugin(v)
                          base := offset
                          for v >= 1<<7 {
                              dAtA[offset] = uint8(v&0x7f | 0x80)
                      Severity: Major
                      Found in protobuf/plugin/plugin.pb.go and 10 other locations - About 35 mins to fix
                      api/ca.pb.go on lines 1076..1086
                      api/dispatcher.pb.go on lines 2431..2441
                      api/health.pb.go on lines 360..370
                      api/logbroker.pb.go on lines 1704..1714
                      api/objects.pb.go on lines 2619..2629
                      api/raft.pb.go on lines 2074..2084
                      api/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

                      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 *TLSAuthorization) CopyFrom(src interface{}) {
                      
                          o := src.(*TLSAuthorization)
                          *m = *o
                          if o.Roles != nil {
                      Severity: Minor
                      Found in protobuf/plugin/plugin.pb.go and 2 other locations - About 30 mins to fix
                      api/ca.pb.go on lines 489..497
                      api/ca.pb.go on lines 533..541

                      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