docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

Method nodePlugin.NodeUnstageVolume has 7 return statements (exceeds 4 allowed).
Open

func (np *nodePlugin) NodeUnstageVolume(ctx context.Context, req *api.VolumeAssignment) error {
    np.mu.Lock()
    defer np.mu.Unlock()
    if !np.staging {
        return nil
Severity: Major
Found in agent/csi/plugin/plugin.go - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if container := actype.Service.Spec.Task.GetContainer(); container != nil {
                                    container.Env = []string{"ENVVARS REDACTED"}
                                    if container.PullOptions != nil {
                                        container.PullOptions.RegistryAuth = "REDACTED"
                                    }
    Severity: Major
    Found in swarmd/cmd/swarm-rafttool/dump.go - About 45 mins to fix

      Function parseRestart has 7 return statements (exceeds 4 allowed).
      Open

      func parseRestart(flags *pflag.FlagSet, spec *api.ServiceSpec) error {
          if spec.Task.Restart == nil {
              // set new service's restart policy as RestartOnAny
              spec.Task.Restart = &api.RestartPolicy{
                  Condition: api.RestartOnAny,
      Severity: Major
      Found in swarmd/cmd/swarmctl/service/flagparser/restart.go - About 45 mins to fix

        Method controller.Remove has 7 return statements (exceeds 4 allowed).
        Open

        func (r *controller) Remove(ctx context.Context) error {
            if err := r.checkClosed(); err != nil {
                return err
            }
        
        
        Severity: Major
        Found in swarmd/dockerexec/controller.go - About 45 mins to fix

          Method Cluster.MarshalToSizedBuffer has 7 return statements (exceeds 4 allowed).
          Open

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

            Avoid deeply nested control flow statements.
            Open

                                if intStringLenmapkey < 0 {
                                    return ErrInvalidLengthObjects
                                }
            Severity: Major
            Found in api/objects.pb.go - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if shift >= 64 {
                                      return ErrIntOverflowObjects
                                  }
              Severity: Major
              Found in api/objects.pb.go - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if postStringIndexmapkey < 0 {
                                        return ErrInvalidLengthObjects
                                    }
                Severity: Major
                Found in api/objects.pb.go - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if b < 0x80 {
                                          break
                                      }
                  Severity: Major
                  Found in api/objects.pb.go - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if b < 0x80 {
                                            break
                                        }
                    Severity: Major
                    Found in api/objects.pb.go - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          for shift := uint(0); ; shift += 7 {
                                              if shift >= 64 {
                                                  return ErrIntOverflowObjects
                                              }
                                              if iNdEx >= l {
                      Severity: Major
                      Found in api/objects.pb.go - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if postStringIndexmapkey > l {
                                                return io.ErrUnexpectedEOF
                                            }
                        Severity: Major
                        Found in api/objects.pb.go - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if postStringIndexmapkey < 0 {
                                                  return ErrInvalidLengthObjects
                                              }
                          Severity: Major
                          Found in api/objects.pb.go - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if postStringIndexmapkey > l {
                                                    return io.ErrUnexpectedEOF
                                                }
                            Severity: Major
                            Found in api/objects.pb.go - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              } else if fieldNum == 2 {
                                                  var stringLenmapvalue uint64
                                                  for shift := uint(0); ; shift += 7 {
                                                      if shift >= 64 {
                                                          return ErrIntOverflowObjects
                              Severity: Major
                              Found in api/objects.pb.go - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if iNdEx >= l {
                                                        return io.ErrUnexpectedEOF
                                                    }
                                Severity: Major
                                Found in api/objects.pb.go - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      for shift := uint(0); ; shift += 7 {
                                                          if shift >= 64 {
                                                              return ErrIntOverflowObjects
                                                          }
                                                          if iNdEx >= l {
                                  Severity: Major
                                  Found in api/objects.pb.go - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if shift >= 64 {
                                                            return ErrIntOverflowObjects
                                                        }
                                    Severity: Major
                                    Found in api/objects.pb.go - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if iNdEx >= l {
                                                              return io.ErrUnexpectedEOF
                                                          }
                                      Severity: Major
                                      Found in api/objects.pb.go - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if intStringLenmapkey < 0 {
                                                                return ErrInvalidLengthObjects
                                                            }
                                        Severity: Major
                                        Found in api/objects.pb.go - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language