dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

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

func parseConfig(cfg map[string]string) (fluent.Config, error) {
    var config fluent.Config

    loc, err := parseAddress(cfg[addressKey])
    if err != nil {
Severity: Major
Found in daemon/logger/fluentd/fluentd.go - About 1 hr to fix

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

    func (daemon *Daemon) ProcessEvent(id string, e libcontainerdtypes.EventType, ei libcontainerdtypes.EventInfo) error {
        c, err := daemon.GetContainer(id)
        if err != nil {
            return errors.Wrapf(err, "could not find container %s", id)
        }
    Severity: Major
    Found in daemon/monitor.go - About 1 hr to fix

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

      func (daemon *Daemon) registerMountPoints(container *container.Container, hostConfig *containertypes.HostConfig, defaultReadOnlyNonRecursive bool) (retErr error) {
          binds := map[string]bool{}
          mountPoints := map[string]*volumemounts.MountPoint{}
          parser := volumemounts.NewParser()
      
      
      Severity: Major
      Found in daemon/volumes.go - About 1 hr to fix

        Function splitConfigRootFSFromTar has 54 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func splitConfigRootFSFromTar(in io.ReadCloser, config *[]byte) io.ReadCloser {
            pr, pw := io.Pipe()
            go func() {
                tarReader := tar.NewReader(in)
                tarWriter := tar.NewWriter(pw)
        Severity: Minor
        Found in plugin/backend_linux.go - About 1 hr to fix

          Method Sandbox.delete has 54 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (sb *Sandbox) delete(ctx context.Context, force bool) error {
              sb.mu.Lock()
              if sb.inDelete {
                  sb.mu.Unlock()
                  return types.ForbiddenErrorf("another sandbox delete in progress")
          Severity: Minor
          Found in libnetwork/sandbox.go - About 1 hr to fix

            Method networkConfiguration.fromLabels has 54 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

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

              Method Builder.dispatchDockerfileWithCancellation has 54 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (b *Builder) dispatchDockerfileWithCancellation(ctx context.Context, parseResult []instructions.Stage, metaArgs []instructions.ArgCommand, escapeToken rune, source builder.Source) (*dispatchState, error) {
                  dispatchRequest := dispatchRequest{}
                  buildArgs := NewBuildArgs(b.options.BuildArgs)
                  totalCommands := len(metaArgs) + len(parseResult)
                  currentCommandIndex := 1
              Severity: Minor
              Found in builder/dockerfile/builder.go - About 1 hr to fix

                Function toBuildkitPruneInfo has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func toBuildkitPruneInfo(opts types.BuildCachePruneOptions) (client.PruneInfo, error) {
                    var until time.Duration
                    untilValues := opts.Filters.Get("until")          // canonical
                    unusedForValues := opts.Filters.Get("unused-for") // deprecated synonym for "until" filter
                
                
                Severity: Minor
                Found in builder/builder-next/builder.go - About 1 hr to fix

                  Method buildRouter.postBuild has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                      var (
                          notVerboseBuffer = bytes.NewBuffer(nil)
                          version          = httputils.VersionFromContext(ctx)
                      )
                  Severity: Minor
                  Found in api/server/router/build/build_routes.go - About 1 hr to fix

                    Function withCgroups has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func withCgroups(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Container) coci.SpecOpts {
                        return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
                            var cgroupsPath string
                            scopePrefix := "docker"
                            parent := "/docker"
                    Severity: Minor
                    Found in daemon/oci_linux.go - About 1 hr to fix

                      Method Daemon.ContainerTop has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

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

                        Method pullProgress.UpdateProgress has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (p pullProgress) UpdateProgress(ctx context.Context, ongoing *jobs, out progress.Output, start time.Time) error {
                            actives, err := p.store.ListStatuses(ctx, "")
                            if err != nil {
                                if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
                                    return err
                        Severity: Minor
                        Found in daemon/containerd/progress.go - About 1 hr to fix

                          Method Cluster.GetTasks has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, error) {
                              var r *swarmapi.ListTasksResponse
                          
                              err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
                                  filterTransform := func(filter filters.Args) error {
                          Severity: Minor
                          Found in daemon/cluster/tasks.go - About 1 hr to fix

                            Function writeContentsForImage has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func writeContentsForImage(ctx context.Context, snName string, cs content.Store,
                                newConfig imagespec.DockerOCIImage, layers []ocispec.Descriptor,
                                containerConfig container.Config,
                            ) (
                                manifestDesc ocispec.Descriptor,
                            Severity: Minor
                            Found in daemon/containerd/image_builder.go - About 1 hr to fix

                              Method ImageService.pruneAll has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (i *ImageService) pruneAll(ctx context.Context, imagesToPrune map[string]containerdimages.Image) (*image.PruneReport, error) {
                                  report := image.PruneReport{}
                              
                                  ctx, span := tracing.StartSpan(ctx, "ImageService.pruneAll")
                                  span.SetAttributes(tracing.Attribute("count", len(imagesToPrune)))
                              Severity: Minor
                              Found in daemon/containerd/image_prune.go - About 1 hr to fix

                                Method ImageService.ImportImage has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                                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: Minor
                                Found in daemon/images/image_import.go - About 1 hr to fix

                                  Method Daemon.update has 54 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (daemon *Daemon) update(name string, hostConfig *container.HostConfig) error {
                                      if hostConfig == nil {
                                          return nil
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in daemon/update.go - About 1 hr to fix

                                    Method Controller.rmServiceBinding has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func (c *Controller) rmServiceBinding(svcName, svcID, nID, eID, containerName string, vip net.IP, ingressPorts []*PortConfig, serviceAliases []string, taskAliases []string, ip net.IP, method string, deleteSvcRecords bool, fullRemove bool) error {
                                    Severity: Major
                                    Found in libnetwork/service_common.go - About 1 hr to fix

                                      Function kubernetesSafeOpen has 53 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func kubernetesSafeOpen(base, subpath string) (int, error) {
                                          // syscall.Openat flags used to traverse directories not following symlinks
                                          const nofollowFlags = unix.O_RDONLY | unix.O_NOFOLLOW
                                          // flags for getting file descriptor without following the symlink
                                          const openFDFlags = unix.O_NOFOLLOW | unix.O_PATH
                                      Severity: Minor
                                      Found in internal/safepath/k8s_safeopen_linux.go - About 1 hr to fix

                                        Method transferManager.transfer has 53 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

                                        func (tm *transferManager) transfer(key string, xferFunc doFunc, progressOutput progress.Output) (transfer, *watcher) {
                                            tm.mu.Lock()
                                            defer tm.mu.Unlock()
                                        
                                            for {
                                        Severity: Minor
                                        Found in distribution/xfer/transfer.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language