dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method linuxParser.validateMountConfigImpl has 67 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSourceExists bool) error {
    if len(mnt.Target) == 0 {
        return &errMountConfig{mnt, errMissingField("Target")}
    }

Severity: Minor
Found in volume/mounts/linux_parser.go - About 1 hr to fix

    Method controller.Start has 67 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

      Function FilterNetworks has 67 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func FilterNetworks(nws []network.Inspect, filter filters.Args) ([]network.Inspect, error) {
          // if filter is empty, return original network list
          if filter.Len() == 0 {
              return nws, nil
          }
      Severity: Minor
      Found in daemon/network/filter.go - About 1 hr to fix

        Method layerStore.RegisterByGraphID has 67 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (ls *layerStore) RegisterByGraphID(graphID string, parent ChainID, diffID DiffID, tarDataFile string, size int64) (Layer, error) {
            // err is used to hold the error which will always trigger
            // cleanup of creates sources but may not be an error returned
            // to the caller (already exists).
            var err error
        Severity: Minor
        Found in layer/migration.go - About 1 hr to fix

          Method puller.pullSchema2Layers has 18 return statements (exceeds 4 allowed).
          Open

          func (p *puller) pullSchema2Layers(ctx context.Context, target distribution.Descriptor, layers []distribution.Descriptor, platform *ocispec.Platform) (id digest.Digest, err error) {
              if _, err := p.config.ImageStore.Get(ctx, target.Digest); err == nil {
                  // If the image already exists locally, no need to pull
                  // anything.
                  return target.Digest, nil
          Severity: Major
          Found in distribution/pull_v2.go - About 1 hr to fix

            Method Endpoint.sbJoin has 18 return statements (exceeds 4 allowed).
            Open

            func (ep *Endpoint) sbJoin(ctx context.Context, sb *Sandbox, options ...EndpointOption) (retErr error) {
                ctx, span := otel.Tracer("").Start(ctx, "libnetwork.sbJoin")
                defer span.End()
            
                n, err := ep.getNetworkFromStore()
            Severity: Major
            Found in libnetwork/endpoint.go - About 1 hr to fix

              Method GossipMessage.Unmarshal has 18 return statements (exceeds 4 allowed).
              Open

              func (m *GossipMessage) Unmarshal(dAtA []byte) error {
                  l := len(dAtA)
                  iNdEx := 0
                  for iNdEx < l {
                      preIndex := iNdEx
              Severity: Major
              Found in libnetwork/networkdb/networkdb.pb.go - About 1 hr to fix

                Method driver.Join has 18 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.ipvlan.Join", trace.WithAttributes(
                        attribute.String("nid", nid),
                        attribute.String("eid", eid),
                        attribute.String("sboxKey", sboxKey)))
                Severity: Major
                Found in libnetwork/drivers/ipvlan/ipvlan_joinleave.go - About 1 hr to fix

                  Method puller.pullManifestList has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                  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: Minor
                  Found in distribution/pull_v2.go - About 1 hr to fix

                    Method cnmNetworkAllocator.allocatePools has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (na *cnmNetworkAllocator) allocatePools(n *api.Network) (map[string]string, error) {
                        ipam, dName, dOptions, err := na.resolveIPAM(n)
                        if err != nil {
                            return nil, err
                        }
                    Severity: Minor
                    Found in libnetwork/cnmallocator/networkallocator.go - About 1 hr to fix

                      Function normalizeLayersAndHistory has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func normalizeLayersAndHistory(diffs []digest.Digest, history []ocispec.History, ref cache.ImmutableRef) ([]digest.Digest, []ocispec.History) {
                          refMeta := getRefMetadata(ref, len(diffs))
                          var historyLayers int
                          for _, h := range history {
                              if !h.EmptyLayer {
                      Severity: Minor
                      Found in builder/builder-next/exporter/mobyexporter/writer.go - About 1 hr to fix

                        Method containerRouter.postContainerExecStart has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

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

                          Method nodeRunner.start has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (n *nodeRunner) start(conf nodeStartConfig) error {
                              var control string
                              if isWindows {
                                  control = `\\.\pipe\` + controlSocket
                              } else {
                          Severity: Minor
                          Found in daemon/cluster/noderunner.go - About 1 hr to fix

                            Method Daemon.cleanupContainer has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (daemon *Daemon) cleanupContainer(container *container.Container, config backend.ContainerRmConfig) error {
                                if container.IsRunning() {
                                    if !config.ForceRemove {
                                        if state := container.StateString(); state == "paused" {
                                            return errdefs.Conflict(fmt.Errorf("cannot remove container %q: container is %s and must be unpaused first", container.Name, state))
                            Severity: Minor
                            Found in daemon/delete.go - About 1 hr to fix

                              Method Daemon.containerExtractToDir has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (daemon *Daemon) containerExtractToDir(container *container.Container, path string, copyUIDGID, noOverwriteDirNonDir bool, content io.Reader) (err error) {
                                  container.Lock()
                                  defer container.Unlock()
                              
                                  // Make sure an online file-system operation is permitted.
                              Severity: Minor
                              Found in daemon/archive_windows.go - About 1 hr to fix

                                Method ImageService.SquashImage has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (i *ImageService) SquashImage(id, parent string) (string, error) {
                                    var (
                                        img *image.Image
                                        err error
                                    )
                                Severity: Minor
                                Found in daemon/images/image_squash.go - About 1 hr to fix

                                  Function changes has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func changes(layers []string, rw string, dc deleteChange, sc skipChange) ([]Change, error) {
                                      var (
                                          changes     []Change
                                          changedDirs = make(map[string]struct{})
                                      )
                                  Severity: Minor
                                  Found in pkg/archive/changes.go - About 1 hr to fix

                                    Method LayerDownloadManager.makeDownloadFuncFromDownload has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func (ldm *LayerDownloadManager) makeDownloadFuncFromDownload(descriptor DownloadDescriptor, sourceDownload *downloadTransfer, parentDownload *downloadTransfer) doFunc {
                                        return func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) transfer {
                                            d := &downloadTransfer{
                                                transfer:   newTransfer(),
                                                layerStore: ldm.layerStore,
                                    Severity: Minor
                                    Found in distribution/xfer/download.go - About 1 hr to fix

                                      Method NetworkDB.clusterInit has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func (nDB *NetworkDB) clusterInit() error {
                                          nDB.lastStatsTimestamp = time.Now()
                                          nDB.lastHealthTimestamp = nDB.lastStatsTimestamp
                                      
                                          config := memberlist.DefaultLANConfig()
                                      Severity: Minor
                                      Found in libnetwork/networkdb/cluster.go - About 1 hr to fix

                                        Function NodeFromGRPC has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

                                        func NodeFromGRPC(n swarmapi.Node) types.Node {
                                            node := types.Node{
                                                ID: n.ID,
                                                Spec: types.NodeSpec{
                                                    Role:         types.NodeRole(strings.ToLower(n.Spec.DesiredRole.String())),
                                        Severity: Minor
                                        Found in daemon/cluster/convert/node.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language