docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

Method storeObjectGen.genMsgStoreObject has 533 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (d *storeObjectGen) genMsgStoreObject(m *generator.Descriptor, storeObject *plugin.StoreObject) {
    ccTypeName := generator.CamelCaseSlice(m.TypeName())

    // Generate event types

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

    Method SelectBy.Unmarshal has 532 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

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

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

      func (m *Secret) Unmarshal(dAtA []byte) error {
          l := len(dAtA)
          iNdEx := 0
          for iNdEx < l {
              preIndex := iNdEx
      Severity: Minor
      Found in api/objects.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

      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 AssignmentsMessage.Unmarshal has a Cognitive Complexity of 131 (exceeds 20 allowed). Consider refactoring.
        Open

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

        func (m *RaftMember) Unmarshal(dAtA []byte) error {
            l := len(dAtA)
            iNdEx := 0
            for iNdEx < l {
                preIndex := iNdEx
        Severity: Minor
        Found in api/raft.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 Cluster.Unmarshal has 484 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

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

          Method testSuite.TestAllocator has 469 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (suite *testSuite) TestAllocator() {
              s := store.NewMemoryStore(nil)
              suite.NotNil(s)
              defer s.Close()
              a := suite.newAllocator(s)
          Severity: Major
          Found in manager/allocator/allocator_test_suite.go - About 2 days to fix

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

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

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

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

              func (m *ConfigSpec) Unmarshal(dAtA []byte) error {
                  l := len(dAtA)
                  iNdEx := 0
                  for iNdEx < l {
                      preIndex := iNdEx
              Severity: Minor
              Found in api/specs.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

              File network.go has 1128 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              package allocator
              
              import (
                  "context"
                  "fmt"
              Severity: Major
              Found in manager/allocator/network.go - About 2 days to fix

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

                // Code generated by protoc-gen-gogo. DO NOT EDIT.
                // source: github.com/docker/swarmkit/api/resource.proto
                
                package api
                
                
                Severity: Major
                Found in api/resource.pb.go - About 2 days to fix

                  File dispatcher.go has 1119 lines of code (exceeds 500 allowed). Consider refactoring.
                  Open

                  package dispatcher
                  
                  import (
                      "context"
                      "fmt"
                  Severity: Major
                  Found in manager/dispatcher/dispatcher.go - About 2 days to fix

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

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

                    func (n *Node) Run(ctx context.Context) error {
                        ctx = log.WithLogger(ctx, logrus.WithField("raft_id", fmt.Sprintf("%x", n.Config.ID)))
                        ctx, cancel := context.WithCancel(ctx)
                    
                        for _, node := range n.bootstrapMembers {
                    Severity: Minor
                    Found in manager/state/raft/raft.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 NodeSpec.Unmarshal has a Cognitive Complexity of 113 (exceeds 20 allowed). Consider refactoring.
                    Open

                    func (m *NodeSpec) Unmarshal(dAtA []byte) error {
                        l := len(dAtA)
                        iNdEx := 0
                        for iNdEx < l {
                            preIndex := iNdEx
                    Severity: Minor
                    Found in api/specs.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

                    Severity
                    Category
                    Status
                    Source
                    Language