dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method PluginSpec.MarshalToSizedBuffer has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (m *PluginSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Minor
Found in api/types/swarm/runtime/plugin.pb.go - About 1 hr to fix

    Method container.createIO has 52 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (c *container) createIO(fifos *cio.FIFOSet, stdinCloseSync chan containerd.Process, attachStdio libcontainerdtypes.StdioCallback) (cio.IO, error) {
        var (
            io  *cio.DirectIO
            err error
        )
    Severity: Minor
    Found in libcontainerd/remote/client.go - About 1 hr to fix

      Method process.reap has 52 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (p *process) reap() {
          logger := p.ctr.client.logger.WithFields(log.Fields{
              "container": p.ctr.id,
              "process":   p.id,
          })
      Severity: Minor
      Found in libcontainerd/local/local_windows.go - About 1 hr to fix

        Function ServiceFromGRPC has 52 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func ServiceFromGRPC(s swarmapi.Service) (types.Service, error) {
            curSpec, err := serviceSpecFromGRPC(&s.Spec)
            if err != nil {
                return types.Service{}, err
            }
        Severity: Minor
        Found in daemon/cluster/convert/service.go - About 1 hr to fix

          Method follow.Do has 52 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (fl *follow) Do(ctx context.Context, f *os.File, read logPos) {
              fl.log = log.G(ctx).WithFields(log.Fields{
                  "module": "logger",
                  "file":   f.Name(),
              })
          Severity: Minor
          Found in daemon/logger/loggerutils/follow.go - About 1 hr to fix

            Method logStream.collectBatch has 52 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (l *logStream) collectBatch(created chan bool) {
                // Wait for the logstream/group to be created
                <-created
                flushInterval := l.forceFlushInterval
                if flushInterval <= 0 {
            Severity: Minor
            Found in daemon/logger/awslogs/cloudwatchlogs.go - About 1 hr to fix

              Function New has 52 lines of code (exceeds 50 allowed). Consider refactoring.
              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: Minor
              Found in daemon/graphdriver/driver.go - About 1 hr to fix

                Method ImageService.GetImage has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (i *ImageService) GetImage(ctx context.Context, refOrID string, options backend.GetImageOpts) (retImg *image.Image, retErr error) {
                    defer func() {
                        if retErr != nil || retImg == nil || options.Platform == nil {
                            return
                        }
                Severity: Minor
                Found in daemon/images/image.go - About 1 hr to fix

                  Function detectManifestBlobMediaType has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                  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: Minor
                  Found in distribution/manifest.go - About 1 hr to fix

                    Function Go has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func Go(flags int, setupfn func() error, fn func()) error {
                        started := make(chan error)
                    
                        maskedFlags := flags
                        for f := range reversibleSetnsFlags {
                    Severity: Minor
                    Found in internal/unshare/unshare_linux.go - About 1 hr to fix

                      Method Client.ContainerCreate has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error) {
                          var response container.CreateResponse
                      
                          // Make sure we negotiated (if the client is configured to do so),
                          // as code below contains API-version specific handling of options.
                      Severity: Minor
                      Found in client/container_create.go - About 1 hr to fix

                        Function serviceSpecFromGRPC has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func serviceSpecFromGRPC(spec *swarmapi.ServiceSpec) (*types.ServiceSpec, error) {
                            if spec == nil {
                                return nil, nil
                            }
                        
                        
                        Severity: Minor
                        Found in daemon/cluster/convert/service.go - About 1 hr to fix

                          Method Daemon.ContainerInspect has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (daemon *Daemon) ContainerInspect(ctx context.Context, name string, options backend.ContainerInspectOptions) (*containertypes.InspectResponse, error) {
                              ctr, err := daemon.GetContainer(name)
                              if err != nil {
                                  return nil, err
                              }
                          Severity: Minor
                          Found in daemon/inspect.go - About 1 hr to fix

                            Function newStreamConfig has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func newStreamConfig(info logger.Info) (*logStreamConfig, error) {
                                logGroupName := info.Config[logGroupKey]
                                logStreamName, err := loggerutils.ParseLogTag(info, "{{.FullID}}")
                                if err != nil {
                                    return nil, err
                            Severity: Minor
                            Found in daemon/logger/awslogs/cloudwatchlogs.go - About 1 hr to fix

                              Function MergeSwarmSpecToGRPC has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func MergeSwarmSpecToGRPC(s types.Spec, spec swarmapi.ClusterSpec) (swarmapi.ClusterSpec, error) {
                                  // We take the initSpec (either created from scratch, or returned by swarmkit),
                                  // and will only change the value if the one taken from types.Spec is not nil or 0.
                                  // In other words, if the value taken from types.Spec is nil or 0, we will maintain the status quo.
                                  if s.Annotations.Name != "" {
                              Severity: Minor
                              Found in daemon/cluster/convert/swarm.go - About 1 hr to fix

                                Method Cluster.Info has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (c *Cluster) Info(ctx context.Context) types.Info {
                                    info := types.Info{
                                        NodeAddr: c.GetAdvertiseAddress(),
                                    }
                                    c.mu.RLock()
                                Severity: Minor
                                Found in daemon/cluster/swarm.go - About 1 hr to fix

                                  Method LocalRegistry.Scan has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (l *LocalRegistry) Scan() ([]string, error) {
                                      var names []string
                                      dirEntries, err := os.ReadDir(l.socketsPath)
                                      if err != nil && !os.IsNotExist(err) {
                                          return nil, errors.Wrap(err, "error reading dir entries")
                                  Severity: Minor
                                  Found in pkg/plugins/discovery.go - About 1 hr to fix

                                    Method puller.pullSchema1 has 10 return statements (exceeds 4 allowed).
                                    Open

                                    func (p *puller) pullSchema1(ctx context.Context, ref reference.Reference, unverifiedManifest *schema1.SignedManifest, platform *ocispec.Platform) (id digest.Digest, manifestDigest digest.Digest, err error) {
                                        if platform != nil {
                                            // Early bath if the requested OS doesn't match that of the configuration.
                                            // This avoids doing the download, only to potentially fail later.
                                            if err := image.CheckOS(platform.OS); err != nil {
                                    Severity: Major
                                    Found in distribution/pull_v2.go - About 1 hr to fix

                                      Method Manager.Pull has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer, opts ...CreateOpt) (err error) {
                                      Severity: Major
                                      Found in plugin/backend_linux.go - About 1 hr to fix

                                        Method tarexporter.legacyLoad has 10 return statements (exceeds 4 allowed).
                                        Open

                                        func (l *tarexporter) legacyLoad(tmpDir string, outStream io.Writer, progressOutput progress.Output) error {
                                            if runtime.GOOS == "windows" {
                                                return errors.New("Windows does not support legacy loading of images")
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in image/tarexport/load.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language