dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Function Parse has 59 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Parse(filePath string, objName string) (*ParsedPkg, error) {
    fs := token.NewFileSet()
    pkg, err := parser.ParseFile(fs, filePath, nil, parser.AllErrors)
    if err != nil {
        return nil, err
Severity: Minor
Found in pkg/plugins/pluginrpc-gen/parser.go - About 1 hr to fix

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

      Method Plugin.Set has 14 return statements (exceeds 4 allowed).
      Open

      func (p *Plugin) Set(args []string) error {
          p.mu.Lock()
          defer p.mu.Unlock()
      
          if p.PluginObj.Enabled {
      Severity: Major
      Found in plugin/v2/plugin.go - About 1 hr to fix

        Method driver.Join has 14 return statements (exceeds 4 allowed).
        Open

        func (d *driver) Join(ctx context.Context, nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, options map[string]interface{}) error {
            ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.macvlan.Join", trace.WithAttributes(
                attribute.String("nid", nid),
                attribute.String("eid", eid),
                attribute.String("sboxKey", sboxKey)))
        Severity: Major
        Found in libnetwork/drivers/macvlan/macvlan_joinleave.go - About 1 hr to fix

          Method ImageService.resolveAllReferences has 14 return statements (exceeds 4 allowed).
          Open

          func (i *ImageService) resolveAllReferences(ctx context.Context, refOrID string) (*containerdimages.Image, []containerdimages.Image, error) {
              parsed, err := reference.ParseAnyReference(refOrID)
              if err != nil {
                  return nil, nil, errdefs.InvalidParameter(err)
              }
          Severity: Major
          Found in daemon/containerd/image.go - About 1 hr to fix

            Method client.createWindows has 14 return statements (exceeds 4 allowed).
            Open

            func (c *client) createWindows(id string, spec *specs.Spec, runtimeOptions interface{}) (*container, error) {
                logger := c.logger.WithField("container", id)
                configuration := &hcsshim.ContainerConfig{
                    SystemType:              "Container",
                    Name:                    id,
            Severity: Major
            Found in libcontainerd/local/local_windows.go - About 1 hr to fix

              Method ImageService.resolveImage has 14 return statements (exceeds 4 allowed).
              Open

              func (i *ImageService) resolveImage(ctx context.Context, refOrID string) (containerdimages.Image, error) {
                  parsed, err := reference.ParseAnyReference(refOrID)
                  if err != nil {
                      return containerdimages.Image{}, errdefs.InvalidParameter(err)
                  }
              Severity: Major
              Found in daemon/containerd/image.go - About 1 hr to fix

                Method ImageService.LoadImage has 14 return statements (exceeds 4 allowed).
                Open

                func (i *ImageService) LoadImage(ctx context.Context, inTar io.ReadCloser, platform *ocispec.Platform, outStream io.Writer, quiet bool) error {
                    decompressed, err := dockerarchive.DecompressStream(inTar)
                    if err != nil {
                        return errors.Wrap(err, "failed to decompress input tar archive")
                    }
                Severity: Major
                Found in daemon/containerd/image_exporter.go - About 1 hr to fix

                  Method ImageService.ExportImage has 14 return statements (exceeds 4 allowed).
                  Open

                  func (i *ImageService) ExportImage(ctx context.Context, names []string, platform *ocispec.Platform, outStream io.Writer) error {
                      pm := i.matchRequestedOrDefault(platforms.OnlyStrict, platform)
                  
                      opts := []archive.ExportOpt{
                          archive.WithSkipNonDistributableBlobs(),
                  Severity: Major
                  Found in daemon/containerd/image_exporter.go - About 1 hr to fix

                    Method Daemon.openContainerFS has 14 return statements (exceeds 4 allowed).
                    Open

                    func (daemon *Daemon) openContainerFS(ctr *container.Container) (_ *containerFSView, retErr error) {
                        ctx := context.TODO()
                    
                        if err := daemon.Mount(ctr); err != nil {
                            return nil, err
                    Severity: Major
                    Found in daemon/containerfs_linux.go - About 1 hr to fix

                      Function New has 14 return statements (exceeds 4 allowed).
                      Open

                      func New(info logger.Info) (logger.Logger, error) {
                          hostname, err := info.Hostname()
                          if err != nil {
                              return nil, fmt.Errorf("%s: cannot access hostname to set source field", driverName)
                          }
                      Severity: Major
                      Found in daemon/logger/splunk/splunk.go - About 1 hr to fix

                        Method Daemon.ContainerRename has 14 return statements (exceeds 4 allowed).
                        Open

                        func (daemon *Daemon) ContainerRename(oldName, newName string) (retErr error) {
                            if oldName == "" || newName == "" {
                                return errdefs.InvalidParameter(errors.New("Neither old nor new names may be empty"))
                            }
                        
                        
                        Severity: Major
                        Found in daemon/rename.go - About 1 hr to fix

                          Method pushDescriptor.layerAlreadyExists has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (pd *pushDescriptor) layerAlreadyExists(
                              ctx context.Context,
                              progressOutput progress.Output,
                              diffID layer.DiffID,
                              checkOtherRepositories bool,
                          Severity: Minor
                          Found in distribution/push_v2.go - About 1 hr to fix

                            Method Controller.reservePools has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (c *Controller) reservePools() {
                                networks, err := c.getNetworks()
                                if err != nil {
                                    log.G(context.TODO()).Warnf("Could not retrieve networks from local store during ipam allocation for existing networks: %v", err)
                                    return
                            Severity: Minor
                            Found in libnetwork/controller.go - About 1 hr to fix

                              Method Controller.addServiceBinding has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (c *Controller) addServiceBinding(svcName, svcID, nID, eID, containerName string, vip net.IP, ingressPorts []*PortConfig, serviceAliases, taskAliases []string, ip net.IP, method string) error {
                                  var addService bool
                              
                                  // Failure to lock the network ID on add can result in racing
                                  // against network deletion resulting in inconsistent state
                              Severity: Minor
                              Found in libnetwork/service_common.go - About 1 hr to fix

                                Method NetworkDB.gossip has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (nDB *NetworkDB) gossip() {
                                    networkNodes := make(map[string][]string)
                                    nDB.RLock()
                                    thisNodeNetworks := nDB.networks[nDB.config.NodeID]
                                    for nid := range thisNodeNetworks {
                                Severity: Minor
                                Found in libnetwork/networkdb/cluster.go - About 1 hr to fix

                                  Method Reader.TestConcurrent has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (tr Reader) TestConcurrent(t *testing.T) {
                                      t.Parallel()
                                      l := tr.Factory(t, logger.Info{
                                          ContainerID:   "logconcurrent0",
                                          ContainerName: "logconcurrent123",
                                  Severity: Minor
                                  Found in daemon/logger/loggertest/logreader.go - About 1 hr to fix

                                    Method ImageService.ImageHistory has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func (i *ImageService) ImageHistory(ctx context.Context, name string, platform *ocispec.Platform) ([]*image.HistoryResponseItem, error) {
                                        start := time.Now()
                                        img, err := i.GetImage(ctx, name, backend.GetImageOpts{Platform: platform})
                                        if err != nil {
                                            return nil, err
                                    Severity: Minor
                                    Found in daemon/images/image_history.go - About 1 hr to fix

                                      Method LayerUploadManager.makeUploadFunc has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func (lum *LayerUploadManager) makeUploadFunc(descriptor UploadDescriptor) doFunc {
                                          return func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) transfer {
                                              u := &uploadTransfer{
                                                  transfer: newTransfer(),
                                              }
                                      Severity: Minor
                                      Found in distribution/xfer/upload.go - About 1 hr to fix

                                        Method Resolver.setupIPTable has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

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