dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Function Join has 10 return statements (exceeds 4 allowed).
Open

func Join(ctx context.Context, path, subpath string) (*SafePath, error) {
    base, subpart, err := evaluatePath(path, subpath)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in internal/safepath/join_windows.go - About 1 hr to fix

    Method Manager.Pull has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, out io.Writer, opts ...CreateOpt) error {
    Severity: Major
    Found in plugin/backend_unsupported.go - About 1 hr to fix

      Method puller.pullManifestList has 10 return statements (exceeds 4 allowed).
      Open

      func (p *puller) pullManifestList(ctx context.Context, ref reference.Named, mfstList *manifestlist.DeserializedManifestList, pp *ocispec.Platform) (id digest.Digest, manifestListDigest digest.Digest, err error) {
          manifestListDigest, err = schema2ManifestDigest(ref, mfstList)
          if err != nil {
              return "", "", err
          }
      Severity: Major
      Found in distribution/pull_v2.go - About 1 hr to fix

        Method addrSpace.allocatePredefinedPool has 10 return statements (exceeds 4 allowed).
        Open

        func (aSpace *addrSpace) allocatePredefinedPool(reserved []netip.Prefix) (netip.Prefix, error) {
            aSpace.mu.Lock()
            defer aSpace.mu.Unlock()
        
            var pdfID int
        Severity: Major
        Found in libnetwork/ipams/defaultipam/address_space.go - About 1 hr to fix

          Method Endpoint.sbLeave has 10 return statements (exceeds 4 allowed).
          Open

          func (ep *Endpoint) sbLeave(ctx context.Context, sb *Sandbox, force bool) error {
              n, err := ep.getNetworkFromStore()
              if err != nil {
                  return fmt.Errorf("failed to get network from store during leave: %v", err)
              }
          Severity: Major
          Found in libnetwork/endpoint.go - About 1 hr to fix

            Method Resolver.setupIPTable has 10 return statements (exceeds 4 allowed).
            Open

            func (r *Resolver) setupIPTable() error {
                if r.err != nil {
                    return r.err
                }
                laddr := r.conn.LocalAddr().String()
            Severity: Major
            Found in libnetwork/resolver_unix.go - About 1 hr to fix

              Method bridgeNetwork.addPortMappings has 10 return statements (exceeds 4 allowed).
              Open

              func (n *bridgeNetwork) addPortMappings(
                  ctx context.Context,
                  epAddrV4, epAddrV6 *net.IPNet,
                  cfg []types.PortBinding,
                  defHostIP net.IP,
              Severity: Major
              Found in libnetwork/drivers/bridge/port_mapping_linux.go - About 1 hr to fix

                Function setupIPChains has 10 return statements (exceeds 4 allowed).
                Open

                func setupIPChains(config configuration, version iptables.IPVersion) (natChain *iptables.ChainInfo, filterChain *iptables.ChainInfo, isolationChain1 *iptables.ChainInfo, isolationChain2 *iptables.ChainInfo, retErr error) {
                    // Sanity check.
                    if version == iptables.IPv4 && !config.EnableIPTables {
                        return nil, nil, nil, nil, errors.New("cannot create new chains, iptables is disabled")
                    }
                Severity: Major
                Found in libnetwork/drivers/bridge/setup_ip_tables_linux.go - About 1 hr to fix

                  Function newImageBuildOptions has 10 return statements (exceeds 4 allowed).
                  Open

                  func newImageBuildOptions(ctx context.Context, r *http.Request) (*types.ImageBuildOptions, error) {
                      options := &types.ImageBuildOptions{
                          Version:        types.BuilderV1, // Builder V1 is the default, but can be overridden
                          Dockerfile:     r.FormValue("dockerfile"),
                          SuppressOutput: httputils.BoolValue(r, "q"),
                  Severity: Major
                  Found in api/server/router/build/build_routes.go - About 1 hr to fix

                    Method networkRouter.getNetwork has 10 return statements (exceeds 4 allowed).
                    Open

                    func (n *networkRouter) getNetwork(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                        if err := httputils.ParseForm(r); err != nil {
                            return err
                        }
                    
                    
                    Severity: Major
                    Found in api/server/router/network/network_routes.go - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if s != "paused" &&
                              s != "restarting" &&
                              s != "removing" &&
                              s != "running" &&
                              s != "dead" &&
                      Severity: Major
                      Found in container/state.go - About 1 hr to fix

                        Method imageRouter.postImagesCreate has 10 return statements (exceeds 4 allowed).
                        Open

                        func (ir *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                            if err := httputils.ParseForm(r); err != nil {
                                return err
                            }
                        
                        
                        Severity: Major
                        Found in api/server/router/image/image_routes.go - About 1 hr to fix

                          Method Daemon.setupMounts has 10 return statements (exceeds 4 allowed).
                          Open

                          func (daemon *Daemon) setupMounts(ctx context.Context, c *container.Container) ([]container.Mount, func(context.Context) error, error) {
                              var mounts []container.Mount
                              // TODO: tmpfs mounts should be part of Mountpoints
                              tmpfsMounts := make(map[string]bool)
                              tmpfsMountInfo, err := c.TmpfsMounts()
                          Severity: Major
                          Found in daemon/volumes_unix.go - About 1 hr to fix

                            Method cacheAdaptor.Get has 10 return statements (exceeds 4 allowed).
                            Open

                            func (c cacheAdaptor) Get(id image.ID) (*image.Image, error) {
                                ctx := context.TODO()
                                ref := id.String()
                            
                                outImg, err := c.is.GetImage(ctx, id.String(), backend.GetImageOpts{})
                            Severity: Major
                            Found in daemon/containerd/cache.go - About 1 hr to fix

                              Method cmdProbe.run has 10 return statements (exceeds 4 allowed).
                              Open

                              func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*containertypes.HealthcheckResult, error) {
                                  startTime := time.Now()
                                  cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
                                  if p.shell {
                                      cmdSlice = append(getShell(cntr), cmdSlice...)
                              Severity: Major
                              Found in daemon/health.go - About 1 hr to fix

                                Method Daemon.ContainerTop has 10 return statements (exceeds 4 allowed).
                                Open

                                func (daemon *Daemon) ContainerTop(name string, psArgs string) (*container.ContainerTopOKBody, error) {
                                    if psArgs == "" {
                                        psArgs = "-ef"
                                    }
                                
                                
                                Severity: Major
                                Found in daemon/top_unix.go - About 1 hr to fix

                                  Method controller.Prepare has 10 return statements (exceeds 4 allowed).
                                  Open

                                  func (r *controller) Prepare(ctx context.Context) error {
                                      if err := r.checkClosed(); err != nil {
                                          return err
                                      }
                                  
                                  
                                  Severity: Major
                                  Found in daemon/cluster/executor/container/controller.go - About 1 hr to fix

                                    Function waitUntilFlushedImpl has 10 return statements (exceeds 4 allowed).
                                    Open

                                    func waitUntilFlushedImpl(s *journald) error {
                                        if s.readSyncTimeout == 0 {
                                            return nil
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in daemon/logger/journald/read.go - About 1 hr to fix

                                      Method Sender.Send has 10 return statements (exceeds 4 allowed).
                                      Open

                                      func (s *Sender) Send(message string, priority journal.Priority, vars map[string]string) error {
                                          if s.TB != nil {
                                              s.TB.Helper()
                                          }
                                          var buf bytes.Buffer
                                      Severity: Major
                                      Found in daemon/logger/journald/internal/fake/sender.go - About 1 hr to fix

                                        Method Daemon.ContainerStats has 10 return statements (exceeds 4 allowed).
                                        Open

                                        func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, config *backend.ContainerStatsConfig) error {
                                            ctr, err := daemon.GetContainer(prefixOrName)
                                            if err != nil {
                                                return err
                                            }
                                        Severity: Major
                                        Found in daemon/stats.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language