dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method Cluster.UnlockSwarm has 8 return statements (exceeds 4 allowed).
Open

func (c *Cluster) UnlockSwarm(req types.UnlockRequest) error {
    c.controlMutex.Lock()
    defer c.controlMutex.Unlock()

    c.mu.RLock()
Severity: Major
Found in daemon/cluster/swarm.go - About 50 mins to fix

    Method Daemon.cleanupContainer has 8 return statements (exceeds 4 allowed).
    Open

    func (daemon *Daemon) cleanupContainer(container *container.Container, config backend.ContainerRmConfig) error {
        if container.IsRunning() {
            if !config.ForceRemove {
                if state := container.StateString(); state == "paused" {
                    return errdefs.Conflict(fmt.Errorf("cannot remove container %q: container is %s and must be unpaused first", container.Name, state))
    Severity: Major
    Found in daemon/delete.go - About 50 mins to fix

      Method Daemon.setupSecretDir has 8 return statements (exceeds 4 allowed).
      Open

      func (daemon *Daemon) setupSecretDir(ctr *container.Container) (setupErr error) {
          if len(ctr.SecretReferences) == 0 {
              return nil
          }
      
      
      Severity: Major
      Found in daemon/container_operations_windows.go - About 50 mins to fix

        Function ValidateLogOpt has 8 return statements (exceeds 4 allowed).
        Open

        func ValidateLogOpt(cfg map[string]string) error {
            for key := range cfg {
                switch key {
                case logGroupKey:
                case logStreamKey:
        Severity: Major
        Found in daemon/logger/awslogs/cloudwatchlogs.go - About 50 mins to fix

          Method Daemon.containerCopy has 8 return statements (exceeds 4 allowed).
          Open

          func (daemon *Daemon) containerCopy(container *container.Container, resource string) (rc io.ReadCloser, err error) {
              if resource[0] == '/' || resource[0] == '\\' {
                  resource = resource[1:]
              }
              container.Lock()
          Severity: Major
          Found in daemon/archive_windows.go - About 50 mins to fix

            Method ImageService.SquashImage has 8 return statements (exceeds 4 allowed).
            Open

            func (i *ImageService) SquashImage(id, parent string) (string, error) {
                var (
                    img *image.Image
                    err error
                )
            Severity: Major
            Found in daemon/images/image_squash.go - About 50 mins to fix

              Method Daemon.containerArchivePath has 8 return statements (exceeds 4 allowed).
              Open

              func (daemon *Daemon) containerArchivePath(container *container.Container, path string) (content io.ReadCloser, stat *containertypes.PathStat, err error) {
                  container.Lock()
              
                  defer func() {
                      if err != nil {
              Severity: Major
              Found in daemon/archive_windows.go - About 50 mins to fix

                Method ImageService.ImportImage has 8 return statements (exceeds 4 allowed).
                Open

                func (i *ImageService) ImportImage(ctx context.Context, newRef reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
                    if platform == nil {
                        def := platforms.DefaultSpec()
                        platform = &def
                    }
                Severity: Major
                Found in daemon/images/image_import.go - About 50 mins to fix

                  Function collectFileInfo has 8 return statements (exceeds 4 allowed).
                  Open

                  func collectFileInfo(sourceDir string) (*FileInfo, error) {
                      root := newRootFileInfo()
                  
                      err := filepath.WalkDir(sourceDir, func(path string, _ os.DirEntry, err error) error {
                          if err != nil {
                  Severity: Major
                  Found in pkg/archive/changes_other.go - About 50 mins to fix

                    Function parseUintList has 8 return statements (exceeds 4 allowed).
                    Open

                    func parseUintList(val string, maximum int) (map[int]bool, error) {
                        if val == "" {
                            return map[int]bool{}, nil
                        }
                    
                    
                    Severity: Major
                    Found in pkg/parsers/parsers.go - About 50 mins to fix

                      Method layerStore.loadLayer has 8 return statements (exceeds 4 allowed).
                      Open

                      func (ls *layerStore) loadLayer(layer ChainID) (*roLayer, error) {
                          cl, ok := ls.layerMap[layer]
                          if ok {
                              return cl, nil
                          }
                      Severity: Major
                      Found in layer/layer_store.go - About 50 mins to fix

                        Function listenFD has 8 return statements (exceeds 4 allowed).
                        Open

                        func listenFD(addr string, tlsConfig *tls.Config) ([]net.Listener, error) {
                            var (
                                err       error
                                listeners []net.Listener
                            )
                        Severity: Major
                        Found in daemon/listeners/listeners_linux.go - About 50 mins to fix

                          Function CopyInfoDestinationPath has 8 return statements (exceeds 4 allowed).
                          Open

                          func CopyInfoDestinationPath(path string) (info CopyInfo, err error) {
                              maxSymlinkIter := 10 // filepath.EvalSymlinks uses 255, but 10 already seems like a lot.
                              path = normalizePath(path)
                              originalPath := path
                          
                          
                          Severity: Major
                          Found in pkg/archive/copy.go - About 50 mins to fix

                            Method layerStore.ReleaseRWLayer has 8 return statements (exceeds 4 allowed).
                            Open

                            func (ls *layerStore) ReleaseRWLayer(l RWLayer) ([]Metadata, error) {
                                name := l.Name()
                                ls.locker.Lock(name)
                                defer ls.locker.Unlock(name)
                            
                            
                            Severity: Major
                            Found in layer/layer_store.go - About 50 mins to fix

                              Function mkdirAs has 8 return statements (exceeds 4 allowed).
                              Open

                              func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error {
                                  path, err := filepath.Abs(path)
                                  if err != nil {
                                      return err
                                  }
                              Severity: Major
                              Found in pkg/idtools/idtools_unix.go - About 50 mins to fix

                                Method tarexporter.loadLayer has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                func (l *tarexporter) loadLayer(ctx context.Context, filename string, rootFS image.RootFS, id string, foreignSrc distribution.Descriptor, progressOutput progress.Output) (_ layer.Layer, outErr error) {
                                Severity: Minor
                                Found in image/tarexport/load.go - About 45 mins to fix

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

                                  func isValidParent(img, parent *image.Image) bool {
                                      if len(img.History) == 0 {
                                          return false
                                      }
                                      if parent == nil || len(parent.History) == 0 && len(parent.RootFS.DiffIDs) == 0 {
                                  Severity: Major
                                  Found in image/cache/cache.go - About 45 mins to fix

                                    Method pushDescriptor.layerAlreadyExists has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        ctx context.Context,
                                        progressOutput progress.Output,
                                        diffID layer.DiffID,
                                        checkOtherRepositories bool,
                                        maxExistenceCheckAttempts int,
                                    Severity: Minor
                                    Found in distribution/push_v2.go - About 45 mins to fix

                                      Method Manager.fetch has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      func (pm *Manager) fetch(ctx context.Context, ref reference.Named, auth *registry.AuthConfig, out progress.Output, metaHeader http.Header, handlers ...images.Handler) (err error) {
                                      Severity: Minor
                                      Found in plugin/fetch_linux.go - About 45 mins to fix

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

                                        func calcSize(ctx context.Context, dir string) (int64, error) {
                                            var size int64
                                            err := filepath.Walk(dir, func(d string, fileInfo os.FileInfo, err error) error {
                                                if err != nil {
                                                    // if dir/x disappeared while walking, Size() ignores dir/x.
                                        Severity: Major
                                        Found in internal/directory/directory_windows.go - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language