dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method sharedTempFileConverter.convert has 6 return statements (exceeds 4 allowed).
Open

func (c *sharedTempFileConverter) convert(f *os.File) (converted *os.File, size int64, err error) {
    dst, err := os.CreateTemp(c.TempDir, "dockerdtemp.*")
    if err != nil {
        return nil, 0, err
    }
Severity: Major
Found in daemon/logger/loggerutils/sharedtemp.go - About 40 mins to fix

    Method reader.readJournal has 6 return statements (exceeds 4 allowed).
    Open

    func (r *reader) readJournal(ctx context.Context) error {
        caughtUp := r.s.ordinal.Load()
        if more, err := r.drainJournal(ctx); err != nil || !more {
            return err
        }
    Severity: Major
    Found in daemon/logger/journald/read.go - About 40 mins to fix

      Method Daemon.ContainerExport has 6 return statements (exceeds 4 allowed).
      Open

      func (daemon *Daemon) ContainerExport(ctx context.Context, name string, out io.Writer) error {
          ctr, err := daemon.GetContainer(name)
          if err != nil {
              return err
          }
      Severity: Major
      Found in daemon/export.go - About 40 mins to fix

        Method Daemon.GetContainer has 6 return statements (exceeds 4 allowed).
        Open

        func (daemon *Daemon) GetContainer(prefixOrName string) (*container.Container, error) {
            if len(prefixOrName) == 0 {
                return nil, errors.WithStack(invalidIdentifier(prefixOrName))
            }
        
        
        Severity: Major
        Found in daemon/container.go - About 40 mins to fix

          Method Daemon.initializeNetworking has 6 return statements (exceeds 4 allowed).
          Open

          func (daemon *Daemon) initializeNetworking(ctx context.Context, cfg *config.Config, ctr *container.Container) error {
              if ctr.HostConfig.NetworkMode.IsContainer() {
                  // we need to get the hosts files from the container to join
                  nc, err := daemon.getNetworkedContainer(ctr.ID, ctr.HostConfig.NetworkMode.ConnectedContainer())
                  if err != nil {
          Severity: Major
          Found in daemon/container_operations.go - About 40 mins to fix

            Function buildCreateEndpointOptions has 6 return statements (exceeds 4 allowed).
            Open

            func buildCreateEndpointOptions(c *container.Container, n *libnetwork.Network, epConfig *network.EndpointSettings, sb *libnetwork.Sandbox, daemonDNS []string) ([]libnetwork.EndpointOption, error) {
                var createOptions []libnetwork.EndpointOption
                genericOptions := make(options.Generic)
            
                nwName := n.Name()
            Severity: Major
            Found in daemon/network.go - About 40 mins to fix

              Method Daemon.getInspectData has 6 return statements (exceeds 4 allowed).
              Open

              func (daemon *Daemon) getInspectData(daemonCfg *config.Config, container *container.Container) (*containertypes.ContainerJSONBase, error) {
                  // make a copy to play with
                  hostConfig := *container.HostConfig
              
                  children := daemon.children(container)
              Severity: Major
              Found in daemon/inspect.go - About 40 mins to fix

                Function FilterNetworks has 6 return statements (exceeds 4 allowed).
                Open

                func FilterNetworks(nws []network.Inspect, filter filters.Args) ([]network.Inspect, error) {
                    // if filter is empty, return original network list
                    if filter.Len() == 0 {
                        return nws, nil
                    }
                Severity: Major
                Found in daemon/network/filter.go - About 40 mins to fix

                  Method Daemon.ContainerAttach has 6 return statements (exceeds 4 allowed).
                  Open

                  func (daemon *Daemon) ContainerAttach(prefixOrName string, req *backend.ContainerAttachConfig) error {
                      keys := []byte{}
                      var err error
                      if req.DetachKeys != "" {
                          keys, err = term.ToBytes(req.DetachKeys)
                  Severity: Major
                  Found in daemon/attach.go - About 40 mins to fix

                    Method ImageService.ImagesPrune has 6 return statements (exceeds 4 allowed).
                    Open

                    func (i *ImageService) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*imagetypes.PruneReport, error) {
                        if !i.pruneRunning.CompareAndSwap(false, true) {
                            return nil, errPruneRunning
                        }
                        defer i.pruneRunning.Store(false)
                    Severity: Major
                    Found in daemon/images/image_prune.go - About 40 mins to fix

                      Method ImageService.imageDeleteHelper has 6 return statements (exceeds 4 allowed).
                      Open

                      func (i *ImageService) imageDeleteHelper(imgID image.ID, records *[]imagetypes.DeleteResponse, force, prune, quiet bool) error {
                          // First, determine if this image has any conflicts. Ignore soft conflicts
                          // if force is true.
                          c := conflictHard
                          if !force {
                      Severity: Major
                      Found in daemon/images/image_delete.go - About 40 mins to fix

                        Function getEndpointPortMapInfo has 6 return statements (exceeds 4 allowed).
                        Open

                        func getEndpointPortMapInfo(ep *libnetwork.Endpoint) (nat.PortMap, error) {
                            pm := nat.PortMap{}
                            driverInfo, err := ep.DriverInfo()
                            if err != nil {
                                return pm, err
                        Severity: Major
                        Found in daemon/network.go - About 40 mins to fix

                          Method Daemon.ContainersPrune has 6 return statements (exceeds 4 allowed).
                          Open

                          func (daemon *Daemon) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (*container.PruneReport, error) {
                              if !daemon.pruneRunning.CompareAndSwap(false, true) {
                                  return nil, errPruneRunning
                              }
                              defer daemon.pruneRunning.Store(false)
                          Severity: Major
                          Found in daemon/prune.go - About 40 mins to fix

                            Function FrozenImagesLinux has 6 return statements (exceeds 4 allowed).
                            Open

                            func FrozenImagesLinux(ctx context.Context, client client.APIClient, images ...string) error {
                                ctx, span := otel.Tracer("").Start(ctx, "LoadFrozenImages")
                                defer span.End()
                            
                                var loadImages []struct{ srcName, destName string }
                            Severity: Major
                            Found in testutil/fixtures/load/frozen.go - About 40 mins to fix

                              Method layerStore.loadMount has 6 return statements (exceeds 4 allowed).
                              Open

                              func (ls *layerStore) loadMount(mount string) error {
                                  ls.mountL.Lock()
                                  defer ls.mountL.Unlock()
                                  if _, ok := ls.mounts[mount]; ok {
                                      return nil
                              Severity: Major
                              Found in layer/layer_store.go - About 40 mins to fix

                                Method Daemon.containerStop has 6 return statements (exceeds 4 allowed).
                                Open

                                func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Container, options containertypes.StopOptions) (retErr error) {
                                    // Cancelling the request should not cancel the stop.
                                    ctx = context.WithoutCancel(ctx)
                                
                                    if !ctr.IsRunning() {
                                Severity: Major
                                Found in daemon/stop.go - About 40 mins to fix

                                  Method layerStore.CreateRWLayer has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (ls *layerStore) CreateRWLayer(name string, parent ChainID, opts *CreateRWLayerOpts) (_ RWLayer, err error) {
                                      var (
                                          storageOpt map[string]string
                                          initFunc   MountInit
                                          mountLabel string
                                  Severity: Major
                                  Found in layer/layer_store.go - About 40 mins to fix

                                    Function storeLayer has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func storeLayer(tx *fileMetadataTransaction, layer *roLayer) error {
                                        if err := tx.SetDiffID(layer.diffID); err != nil {
                                            return err
                                        }
                                        if err := tx.SetSize(layer.size); err != nil {
                                    Severity: Major
                                    Found in layer/ro_layer.go - About 40 mins to fix

                                      Function parseExpr has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func parseExpr(e ast.Expr) (parsedExpr, error) {
                                          var parsed parsedExpr
                                          switch i := e.(type) {
                                          case *ast.Ident:
                                              parsed.value += i.Name
                                      Severity: Major
                                      Found in pkg/plugins/pluginrpc-gen/parser.go - About 40 mins to fix

                                        Method Config.ValidatePlatformConfig has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func (conf *Config) ValidatePlatformConfig() error {
                                            if conf.EnableUserlandProxy {
                                                if conf.UserlandProxyPath == "" {
                                                    return errors.New("invalid userland-proxy-path: userland-proxy is enabled, but userland-proxy-path is not set")
                                                }
                                        Severity: Major
                                        Found in daemon/config/config_linux.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language