docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

File scheduler.go has 684 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package scheduler

import (
    "context"
    "sync"
Severity: Minor
Found in manager/scheduler/scheduler.go - About 6 hrs to fix

    Method Service.Unmarshal has 74 return statements (exceeds 4 allowed).
    Open

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

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

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

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

      Cognitive Complexity

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

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

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

      Further reading

      Method Task.MarshalToSizedBuffer has 180 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

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

        File server.go has 672 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        package ca
        
        import (
            "bytes"
            "context"
        Severity: Minor
        Found in ca/server.go - About 6 hrs to fix

          Method Extension.Unmarshal has 177 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

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

            Method JoinResponse.Unmarshal has 176 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

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

              Method testSuite.TestAllocatorRestoreForUnallocatedNetwork has 173 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (suite *testSuite) TestAllocatorRestoreForUnallocatedNetwork() {
                  s := store.NewMemoryStore(nil)
                  suite.NotNil(s)
                  defer s.Close()
                  // Create 3 services with 1 task each
              Severity: Major
              Found in manager/allocator/allocator_test_suite.go - About 5 hrs to fix

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

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

                Cognitive Complexity

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

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

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

                Further reading

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

                func parseTmpfs(flags *pflag.FlagSet, spec *api.ServiceSpec) error {
                    if flags.Changed("tmpfs") {
                        tmpfss, err := flags.GetStringSlice("tmpfs")
                        if err != nil {
                            return err
                Severity: Minor
                Found in swarmd/cmd/swarmctl/service/flagparser/tmpfs.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

                Severity
                Category
                Status
                Source
                Language