dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method imageRouter.postImagesPush has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (ir *imageRouter) postImagesPush(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
    metaHeaders := map[string][]string{}
    for k, v := range r.Header {
        if strings.HasPrefix(k, "X-Meta-") {
            metaHeaders[k] = v
Severity: Minor
Found in api/server/router/image/image_routes.go - About 1 hr to fix

    Function withCommonOptions has 55 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func withCommonOptions(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Container) coci.SpecOpts {
        return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
            if c.BaseFS == "" {
                return errors.New("populateCommonSpec: BaseFS of container " + c.ID + " is unexpectedly empty")
            }
    Severity: Minor
    Found in daemon/oci_linux.go - About 1 hr to fix

      Method containerRouter.wsContainersAttach has 55 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (c *containerRouter) wsContainersAttach(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
          if err := httputils.ParseForm(r); err != nil {
              return err
          }
          containerName := vars["name"]
      Severity: Minor
      Found in api/server/router/container/container_routes.go - About 1 hr to fix

        Method ImageService.deleteAll has 55 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (i *ImageService) deleteAll(ctx context.Context, imgID image.ID, all []images.Image, c conflictType, prune bool) (records []imagetypes.DeleteResponse, err error) {
            // Workaround for: https://github.com/moby/buildkit/issues/3797
            possiblyDeletedConfigs := map[digest.Digest]struct{}{}
            if len(all) > 0 && i.content != nil {
                handled := map[digest.Digest]struct{}{}
        Severity: Minor
        Found in daemon/containerd/image_delete.go - About 1 hr to fix

          Function New has 55 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func New(info logger.Info) (logger.Logger, error) {
              containerStreamConfig, err := newStreamConfig(info)
              if err != nil {
                  return nil, err
              }
          Severity: Minor
          Found in daemon/logger/awslogs/cloudwatchlogs.go - About 1 hr to fix

            Function New has 55 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func New(info logger.Info) (logger.Logger, error) {
                // parse gelf address
                address, err := parseAddress(info.Config["gelf-address"])
                if err != nil {
                    return nil, err
            Severity: Minor
            Found in daemon/logger/gelf/gelf.go - About 1 hr to fix

              Method reader.readLogs has 55 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (r *reader) readLogs(ctx context.Context) {
                  defer close(r.logWatcher.Msg)
              
                  // Make sure the ready channel is closed in the event of an early
                  // return.
              Severity: Minor
              Found in daemon/logger/journald/read.go - About 1 hr to fix

                Function waitUntilFlushedImpl has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

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

                  Function SwarmFromGRPC has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm {
                      swarm := types.Swarm{
                          ClusterInfo: types.ClusterInfo{
                              ID: c.ID,
                              Spec: types.Spec{
                  Severity: Minor
                  Found in daemon/cluster/convert/swarm.go - About 1 hr to fix

                    Function toContainerdResources has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func toContainerdResources(resources container.Resources) *libcontainerdtypes.Resources {
                        var r libcontainerdtypes.Resources
                    
                        if resources.BlkioWeight != 0 {
                            r.BlockIO = &specs.LinuxBlockIO{
                    Severity: Minor
                    Found in daemon/update_linux.go - About 1 hr to fix

                      Method Daemon.containerCopy has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                      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: Minor
                      Found in daemon/archive_windows.go - About 1 hr to fix

                        Function detectManifestBlobMediaType has 12 return statements (exceeds 4 allowed).
                        Open

                        func detectManifestBlobMediaType(dt []byte) (string, error) {
                            var mfst struct {
                                MediaType string          `json:"mediaType"`
                                Manifests json.RawMessage `json:"manifests"` // oci index, manifest list
                                Config    json.RawMessage `json:"config"`    // schema2 Manifest
                        Severity: Major
                        Found in distribution/manifest.go - About 1 hr to fix

                          Method networkConfiguration.fromLabels has 12 return statements (exceeds 4 allowed).
                          Open

                          func (c *networkConfiguration) fromLabels(labels map[string]string) error {
                              var err error
                              for label, value := range labels {
                                  switch label {
                                  case BridgeName:
                          Severity: Major
                          Found in libnetwork/drivers/bridge/bridge_linux.go - About 1 hr to fix

                            Method driver.CreateNetwork has 12 return statements (exceeds 4 allowed).
                            Open

                            func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                                if _, err := d.getNetwork(id); err == nil {
                                    return types.ForbiddenErrorf("network %s exists", id)
                                }
                            
                            
                            Severity: Major
                            Found in libnetwork/drivers/windows/windows.go - About 1 hr to fix

                              Method systemRouter.getEvents has 12 return statements (exceeds 4 allowed).
                              Open

                              func (s *systemRouter) getEvents(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 1 hr to fix

                                Method ImageService.Images has 12 return statements (exceeds 4 allowed).
                                Open

                                func (i *ImageService) Images(ctx context.Context, opts imagetypes.ListOptions) ([]*imagetypes.Summary, error) {
                                    if err := opts.Filters.Validate(acceptedImageFilterTags); err != nil {
                                        return nil, err
                                    }
                                
                                
                                Severity: Major
                                Found in daemon/containerd/image_list.go - About 1 hr to fix

                                  Method ImageService.pullTag has 12 return statements (exceeds 4 allowed).
                                  Open

                                  func (i *ImageService) pullTag(ctx context.Context, ref reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registrytypes.AuthConfig, out progress.Output) error {
                                      var opts []containerd.RemoteOpt
                                      if platform != nil {
                                          opts = append(opts, containerd.WithPlatform(platforms.Format(*platform)))
                                      }
                                  Severity: Major
                                  Found in daemon/containerd/image_pull.go - About 1 hr to fix

                                    Method Cluster.ServiceLogs has 12 return statements (exceeds 4 allowed).
                                    Open

                                    func (c *Cluster) ServiceLogs(ctx context.Context, selector *backend.LogSelector, config *container.LogsOptions) (<-chan *backend.LogMessage, error) {
                                        c.mu.RLock()
                                        defer c.mu.RUnlock()
                                    
                                        state := c.currentNodeState()
                                    Severity: Major
                                    Found in daemon/cluster/services.go - About 1 hr to fix

                                      Method ImageService.pushRef has 12 return statements (exceeds 4 allowed).
                                      Open

                                      func (i *ImageService) pushRef(ctx context.Context, targetRef reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, out progress.Output) (retErr error) {
                                          leasedCtx, release, err := i.client.WithLease(ctx)
                                          if err != nil {
                                              return err
                                          }
                                      Severity: Major
                                      Found in daemon/containerd/image_push.go - About 1 hr to fix

                                        Method Daemon.ContainerExecStart has 12 return statements (exceeds 4 allowed).
                                        Open

                                        func (daemon *Daemon) ContainerExecStart(ctx context.Context, name string, options backend.ExecStartConfig) (err error) {
                                            var (
                                                cStdin           io.ReadCloser
                                                cStdout, cStderr io.Writer
                                            )
                                        Severity: Major
                                        Found in daemon/exec.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language