dotcloud/docker

View on GitHub

Showing 1,904 of 1,904 total issues

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

func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {
    var (
        allowNonDistributable = opts.NewNamedListOptsRef("allow-nondistributable-artifacts", &conf.AllowNondistributableArtifacts, registry.ValidateIndexName)
        registryMirrors       = opts.NewNamedListOptsRef("registry-mirrors", &conf.Mirrors, registry.ValidateMirror)
        insecureRegistries    = opts.NewNamedListOptsRef("insecure-registries", &conf.InsecureRegistries, registry.ValidateIndexName)
Severity: Minor
Found in cmd/dockerd/config.go - About 1 hr to fix

    Method imageRouter.getImagesJSON has 52 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (ir *imageRouter) getImagesJSON(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/image/image_routes.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

        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 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 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 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

                  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

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                            case 2:
                                if wireType != 0 {
                                    return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
                                }
                                m.LTime = 0
                    Severity: Major
                    Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
                    libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
                    libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
                    libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
                    libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
                    libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 133.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                            case 2:
                                if wireType != 0 {
                                    return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
                                }
                                m.LTime = 0
                    Severity: Major
                    Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
                    libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
                    libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
                    libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
                    libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
                    libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 133.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                            case 1:
                                if wireType != 0 {
                                    return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
                                }
                                m.LTime = 0
                    Severity: Major
                    Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
                    libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
                    libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
                    libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
                    libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
                    libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 133.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                            case 2:
                                if wireType != 0 {
                                    return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
                                }
                                m.LTime = 0
                    Severity: Major
                    Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
                    libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
                    libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
                    libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
                    libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
                    libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 133.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                            case 2:
                                if wireType != 0 {
                                    return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
                                }
                                m.LTime = 0
                    Severity: Major
                    Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
                    libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
                    libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
                    libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
                    libnetwork/networkdb/networkdb.pb.go on lines 2432..2450
                    libnetwork/networkdb/networkdb.pb.go on lines 2682..2700

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 133.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                            case 1:
                                if wireType != 0 {
                                    return fmt.Errorf("proto: wrong wireType = %d for field LTime", wireType)
                                }
                                m.LTime = 0
                    Severity: Major
                    Found in libnetwork/networkdb/networkdb.pb.go and 5 other locations - About 1 hr to fix
                    libnetwork/networkdb/networkdb.pb.go on lines 1872..1890
                    libnetwork/networkdb/networkdb.pb.go on lines 1992..2010
                    libnetwork/networkdb/networkdb.pb.go on lines 2157..2175
                    libnetwork/networkdb/networkdb.pb.go on lines 2278..2296
                    libnetwork/networkdb/networkdb.pb.go on lines 2432..2450

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 133.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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 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

                          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 Daemon.ContainerInspectCurrent has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (daemon *Daemon) ContainerInspectCurrent(ctx context.Context, name string, size bool) (*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
                              Severity
                              Category
                              Status
                              Source
                              Language