dotcloud/docker

View on GitHub

Showing 1,904 of 1,904 total issues

Consider simplifying this complex logical expression.
Open

    if s != "paused" &&
        s != "restarting" &&
        s != "removing" &&
        s != "running" &&
        s != "dead" &&
Severity: Major
Found in container/state.go - About 1 hr to fix

    Method cacheAdaptor.Get has 10 return statements (exceeds 4 allowed).
    Open

    func (c cacheAdaptor) Get(id image.ID) (*image.Image, error) {
        ctx := context.TODO()
        ref := id.String()
    
        outImg, err := c.is.GetImage(ctx, id.String(), backend.GetImageOpts{})
    Severity: Major
    Found in daemon/containerd/cache.go - About 1 hr to fix

      Method Daemon.setupMounts has 10 return statements (exceeds 4 allowed).
      Open

      func (daemon *Daemon) setupMounts(ctx context.Context, c *container.Container) ([]container.Mount, func(context.Context) error, error) {
          var mounts []container.Mount
          // TODO: tmpfs mounts should be part of Mountpoints
          tmpfsMounts := make(map[string]bool)
          tmpfsMountInfo, err := c.TmpfsMounts()
      Severity: Major
      Found in daemon/volumes_unix.go - About 1 hr to fix

        Method cmdProbe.run has 10 return statements (exceeds 4 allowed).
        Open

        func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*containertypes.HealthcheckResult, error) {
            startTime := time.Now()
            cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
            if p.shell {
                cmdSlice = append(getShell(cntr), cmdSlice...)
        Severity: Major
        Found in daemon/health.go - About 1 hr to fix

          Method controller.Prepare has 10 return statements (exceeds 4 allowed).
          Open

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

            Method Daemon.ContainerTop has 10 return statements (exceeds 4 allowed).
            Open

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

              Function validateHostConfig has 10 return statements (exceeds 4 allowed).
              Open

              func validateHostConfig(hostConfig *containertypes.HostConfig) error {
                  if hostConfig == nil {
                      return nil
                  }
              
              
              Severity: Major
              Found in daemon/container.go - About 1 hr to fix

                Method Sender.Send has 10 return statements (exceeds 4 allowed).
                Open

                func (s *Sender) Send(message string, priority journal.Priority, vars map[string]string) error {
                    if s.TB != nil {
                        s.TB.Helper()
                    }
                    var buf bytes.Buffer
                Severity: Major
                Found in daemon/logger/journald/internal/fake/sender.go - About 1 hr to fix

                  Method Daemon.ContainerStats has 10 return statements (exceeds 4 allowed).
                  Open

                  func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, config *backend.ContainerStatsConfig) error {
                      ctr, err := daemon.GetContainer(prefixOrName)
                      if err != nil {
                          return err
                      }
                  Severity: Major
                  Found in daemon/stats.go - About 1 hr to fix

                    Function New has 10 return statements (exceeds 4 allowed).
                    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: Major
                    Found in daemon/logger/gelf/gelf.go - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if !splunkURL.IsAbs() ||
                              (splunkURL.Scheme != "http" && splunkURL.Scheme != "https") ||
                              (splunkURL.Path != "" && splunkURL.Path != "/") ||
                              splunkURL.RawQuery != "" ||
                              splunkURL.Fragment != "" {
                      Severity: Major
                      Found in daemon/logger/splunk/splunk.go - About 1 hr to fix

                        Function waitUntilFlushedImpl has 10 return statements (exceeds 4 allowed).
                        Open

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

                          Consider simplifying this complex logical expression.
                          Open

                              if path[1] == ':' &&
                                  ('0' <= c && c <= '9' || 'a' <= c && c <= 'z' ||
                                      'A' <= c && c <= 'Z') {
                          Severity: Major
                          Found in daemon/logger/loggerutils/file_windows.go - About 1 hr to fix

                            Method Daemon.containerExtractToDir has 10 return statements (exceeds 4 allowed).
                            Open

                            func (daemon *Daemon) containerExtractToDir(container *container.Container, path string, copyUIDGID, noOverwriteDirNonDir bool, content io.Reader) (err error) {
                                container.Lock()
                                defer container.Unlock()
                            
                                cfs, err := daemon.openContainerFS(container)
                            Severity: Major
                            Found in daemon/archive_unix.go - About 1 hr to fix

                              Method Daemon.createNetwork has 10 return statements (exceeds 4 allowed).
                              Open

                              func (daemon *Daemon) createNetwork(cfg *config.Config, create networktypes.CreateRequest, id string, agent bool) (*networktypes.CreateResponse, error) {
                                  if network.IsPredefined(create.Name) {
                                      return nil, PredefinedNetworkError(create.Name)
                                  }
                              
                              
                              Severity: Major
                              Found in daemon/network.go - About 1 hr to fix

                                Method ImageService.GetImageAndReleasableLayer has 10 return statements (exceeds 4 allowed).
                                Open

                                func (i *ImageService) GetImageAndReleasableLayer(ctx context.Context, refOrID string, opts backend.GetImageAndLayerOptions) (builder.Image, builder.ROLayer, error) {
                                    if refOrID == "" { // FROM scratch
                                        if runtime.GOOS == "windows" {
                                            return nil, nil, fmt.Errorf(`"FROM scratch" is not supported on Windows`)
                                        }
                                Severity: Major
                                Found in daemon/images/image_builder.go - About 1 hr to fix

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

                                  func New(name string, config Options) (Driver, error) {
                                      ctx := context.TODO()
                                      if name != "" {
                                          log.G(ctx).Infof("[graphdriver] trying configured driver: %s", name)
                                          if err := checkRemoved(name); err != nil {
                                  Severity: Major
                                  Found in daemon/graphdriver/driver.go - About 1 hr to fix

                                    Function Validate has 10 return statements (exceeds 4 allowed).
                                    Open

                                    func Validate(config *Config) error {
                                        // validate log-level
                                        if config.LogLevel != "" {
                                            // FIXME(thaJeztah): find a better way for this; this depends on knowledge of containerd's log package internals.
                                            // Alternatively: try  log.SetLevel(config.LogLevel), and restore the original level, but this also requires internal knowledge.
                                    Severity: Major
                                    Found in daemon/config/config.go - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                          if oldStat.Mode() != newStat.Mode() ||
                                              oldStat.UID() != newStat.UID() ||
                                              oldStat.GID() != newStat.GID() ||
                                              oldStat.Rdev() != newStat.Rdev() ||
                                              // Don't look at size or modification time for dirs, its not a good
                                      Severity: Major
                                      Found in pkg/archive/changes_unix.go - About 1 hr to fix

                                        Function changes has 10 return statements (exceeds 4 allowed).
                                        Open

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