docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

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

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

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

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

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

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

func skipSpecs(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/specs.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 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 Node.loadAndStart has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func (n *Node) loadAndStart(ctx context.Context, forceNewCluster bool) error {
    snapshot, waldata, err := n.readFromDisk(ctx)
    if err != nil {
        return err
    }
Severity: Minor
Found in manager/state/raft/storage.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 SubscriptionMessage.Unmarshal has 171 lines of code (exceeds 50 allowed). Consider refactoring.
Open

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

    Method Agent.run has 168 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (a *Agent) run(ctx context.Context) {
        ctx, cancel := context.WithCancel(ctx)
        defer cancel()
        defer close(a.closed) // full shutdown.
    
    
    Severity: Major
    Found in agent/agent.go - About 5 hrs to fix

      Method testSuite.TestNodeAllocator has 168 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (suite *testSuite) TestNodeAllocator() {
          s := store.NewMemoryStore(nil)
          suite.NotNil(s)
          defer s.Close()
      
      
      Severity: Major
      Found in manager/allocator/allocator_test_suite.go - About 5 hrs to fix

        Method Secret.Unmarshal has 165 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

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

          Function parseUpdate has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
          Open

          func parseUpdate(flags *pflag.FlagSet, spec *api.ServiceSpec) error {
              if flags.Changed("update-parallelism") {
                  parallelism, err := flags.GetUint64("update-parallelism")
                  if err != nil {
                      return err
          Severity: Minor
          Found in swarmd/cmd/swarmctl/service/flagparser/update.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 ClusterSpec.Unmarshal has 65 return statements (exceeds 4 allowed).
          Open

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

            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 AssignmentsMessage.Unmarshal has 164 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

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

              Method RaftMember.Unmarshal has 163 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

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

                Function dumpSnapshot has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
                Open

                func dumpSnapshot(swarmdir, unlockKey string, redact bool) error {
                    _, snapshot, err := loadData(swarmdir, unlockKey)
                    if err != nil {
                        return err
                    }
                Severity: Minor
                Found in swarmd/cmd/swarm-rafttool/dump.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 Server.ListServiceStatuses has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
                Open

                func (s *Server) ListServiceStatuses(ctx context.Context, req *api.ListServiceStatusesRequest) (*api.ListServiceStatusesResponse, error) {
                    resp := &api.ListServiceStatusesResponse{}
                    if req == nil {
                        return resp, nil
                    }
                Severity: Minor
                Found in manager/controlapi/service.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 readTx.findIterators has 159 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (tx readTx) findIterators(table string, by By, checkType func(By) error) ([]memdb.ResultIterator, error) {
                    switch by.(type) {
                    case byAll, orCombinator: // generic types
                    default: // all other types
                        if err := checkType(by); err != nil {
                Severity: Major
                Found in manager/state/store/memory.go - About 5 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language