dotcloud/docker

View on GitHub

Showing 1,904 of 1,904 total issues

Method cnmNetworkAllocator.IsTaskAllocated has 6 return statements (exceeds 4 allowed).
Open

func (na *cnmNetworkAllocator) IsTaskAllocated(t *api.Task) bool {
    // If the task is not found in the allocated set, then it is
    // not allocated.
    if _, ok := na.tasks[t.ID]; !ok {
        return false
Severity: Major
Found in libnetwork/cnmallocator/networkallocator.go - About 40 mins to fix

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

    func getMountOptions(opts *optsConfig, resolveIP func(string, string) (*net.IPAddr, error)) (mountDevice string, mountOpts string, _ error) {
        if opts.MountDevice == "" {
            return "", "", fmt.Errorf("missing device in volume options")
        }
    
    
    Severity: Major
    Found in volume/local/local_unix.go - About 40 mins to fix

      Method session.searchRepositories has 6 return statements (exceeds 4 allowed).
      Open

      func (r *session) searchRepositories(term string, limit int) (*registry.SearchResults, error) {
          if limit == 0 {
              limit = defaultSearchLimit
          }
          if limit < 1 || limit > 100 {
      Severity: Major
      Found in registry/search_session.go - About 40 mins to fix

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

        func newV1Endpoint(index *registry.IndexInfo, headers http.Header) (*v1Endpoint, error) {
            tlsConfig, err := newTLSConfig(index.Name, index.Secure)
            if err != nil {
                return nil, err
            }
        Severity: Major
        Found in registry/search_endpoint_v1.go - About 40 mins to fix

          Method Client.checkPluginPermissions has 6 return statements (exceeds 4 allowed).
          Open

          func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values, options types.PluginInstallOptions) (types.PluginPrivileges, error) {
              resp, err := cli.tryPluginPrivileges(ctx, query, options.RegistryAuth)
              if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil {
                  // todo: do inspect before to check existing name before checking privileges
                  newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx)
          Severity: Major
          Found in client/plugin_install.go - About 40 mins to fix

            Method Worker.GetRemotes has 6 return statements (exceeds 4 allowed).
            Open

            func (w *Worker) GetRemotes(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool, _ cacheconfig.RefConfig, all bool, s session.Group) ([]*solver.Remote, error) {
                if ref == nil {
                    return nil, nil
                }
                var diffIDs []layer.DiffID
            Severity: Major
            Found in builder/builder-next/worker/worker.go - About 40 mins to fix

              Method containerRouter.postCommit has 6 return statements (exceeds 4 allowed).
              Open

              func (s *containerRouter) postCommit(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/container/container_routes.go - About 40 mins to fix

                Method imageRouter.postImagesTag has 6 return statements (exceeds 4 allowed).
                Open

                func (ir *imageRouter) postImagesTag(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 40 mins to fix

                  Method Builder.Prune has 6 return statements (exceeds 4 allowed).
                  Open

                  func (b *Builder) Prune(ctx context.Context, opts types.BuildCachePruneOptions) (int64, []string, error) {
                      ch := make(chan *controlapi.UsageRecord)
                  
                      eg, ctx := errgroup.WithContext(ctx)
                  
                  
                  Severity: Major
                  Found in builder/builder-next/builder.go - About 40 mins to fix

                    Method containerRouter.postContainersAttach has 6 return statements (exceeds 4 allowed).
                    Open

                    func (s *containerRouter) postContainersAttach(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                        err := httputils.ParseForm(r)
                        if err != nil {
                            return err
                        }
                    Severity: Major
                    Found in api/server/router/container/container_routes.go - About 40 mins to fix

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

                      func dispatch(ctx context.Context, d dispatchRequest, cmd instructions.Command) (err error) {
                          if c, ok := cmd.(instructions.PlatformSpecific); ok {
                              err := c.CheckPlatform(d.state.operatingSystem)
                              if err != nil {
                                  return errdefs.InvalidParameter(err)
                      Severity: Major
                      Found in builder/dockerfile/evaluator.go - About 40 mins to fix

                        Method systemRouter.getDiskUsage has 6 return statements (exceeds 4 allowed).
                        Open

                        func (s *systemRouter) getDiskUsage(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/system/system_routes.go - About 40 mins to fix

                          Method Service.searchUnfiltered has 6 return statements (exceeds 4 allowed).
                          Open

                          func (s *Service) searchUnfiltered(ctx context.Context, term string, limit int, authConfig *registry.AuthConfig, headers http.Header) (*registry.SearchResults, error) {
                              // TODO Use ctx when searching for repositories
                              if hasScheme(term) {
                                  return nil, invalidParamf("invalid repository name: repository name (%s) should not have a scheme", term)
                              }
                          Severity: Major
                          Found in registry/search.go - About 40 mins to fix

                            Method networkRouter.postNetworkCreate has 6 return statements (exceeds 4 allowed).
                            Open

                            func (n *networkRouter) postNetworkCreate(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 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  if d.state.operatingSystem == "windows" &&
                                      d.state.runConfig.ArgsEscaped != argsEscaped &&
                                      ((len(runConfig.Cmd) == 1 && strings.ToLower(runConfig.Cmd[0]) != `c:\windows\system32\cmd.exe` && len(runConfig.Shell) == 0) || (len(runConfig.Cmd) > 1)) {
                              Severity: Major
                              Found in builder/dockerfile/dispatchers.go - About 40 mins to fix

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

                                func withDockerfileFromContext(c modifiableContext, dockerfilePath string) (builder.Source, *parser.Result, error) {
                                    df, err := openAt(c, dockerfilePath)
                                    if err != nil {
                                        if errors.Is(err, os.ErrNotExist) {
                                            if dockerfilePath == builder.DefaultDockerfileName {
                                Severity: Major
                                Found in builder/remotecontext/detect.go - About 40 mins to fix

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

                                  func notifyClosed(ctx context.Context, conn net.Conn, notify func()) {
                                      sc, ok := conn.(syscall.Conn)
                                      if !ok {
                                          log.G(ctx).Debug("notifyClosed: conn does not support close notifications")
                                          return
                                  Severity: Major
                                  Found in api/server/router/container/notify_linux.go - About 40 mins to fix

                                    Method pluginRouter.upgradePlugin has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (pr *pluginRouter) upgradePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                                        if err := httputils.ParseForm(r); err != nil {
                                            return errors.Wrap(err, "failed to parse form")
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in api/server/router/plugin/plugin_routes.go - About 40 mins to fix

                                      Method containerManager.Run has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr io.Writer) (err error) {
                                          attached := make(chan struct{})
                                          errCh := make(chan error, 1)
                                          go func() {
                                              errCh <- c.backend.ContainerAttachRaw(cID, nil, stdout, stderr, true, attached)
                                      Severity: Major
                                      Found in builder/dockerfile/containerbackend.go - About 40 mins to fix

                                        Method pluginRouter.pullPlugin has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func (pr *pluginRouter) pullPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                                            if err := httputils.ParseForm(r); err != nil {
                                                return errors.Wrap(err, "failed to parse form")
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in api/server/router/plugin/plugin_routes.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language