dotcloud/docker

View on GitHub

Showing 1,904 of 1,904 total issues

Method ImageService.SquashImage has 8 return statements (exceeds 4 allowed).
Open

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

    Method Daemon.containerCopy has 8 return statements (exceeds 4 allowed).
    Open

    func (daemon *Daemon) containerCopy(container *container.Container, resource string) (rc io.ReadCloser, err error) {
        if resource[0] == '/' || resource[0] == '\\' {
            resource = resource[1:]
        }
        container.Lock()
    Severity: Major
    Found in daemon/archive_windows.go - About 50 mins to fix

      Function CopyInfoDestinationPath has 8 return statements (exceeds 4 allowed).
      Open

      func CopyInfoDestinationPath(path string) (info CopyInfo, err error) {
          maxSymlinkIter := 10 // filepath.EvalSymlinks uses 255, but 10 already seems like a lot.
          path = normalizePath(path)
          originalPath := path
      
      
      Severity: Major
      Found in pkg/archive/copy.go - About 50 mins to fix

        Function listenFD has 8 return statements (exceeds 4 allowed).
        Open

        func listenFD(addr string, tlsConfig *tls.Config) ([]net.Listener, error) {
            var (
                err       error
                listeners []net.Listener
            )
        Severity: Major
        Found in daemon/listeners/listeners_linux.go - About 50 mins to fix

          Function parseUintList has 8 return statements (exceeds 4 allowed).
          Open

          func parseUintList(val string, maximum int) (map[int]bool, error) {
              if val == "" {
                  return map[int]bool{}, nil
              }
          
          
          Severity: Major
          Found in pkg/parsers/parsers.go - About 50 mins to fix

            Function collectFileInfo has 8 return statements (exceeds 4 allowed).
            Open

            func collectFileInfo(sourceDir string) (*FileInfo, error) {
                root := newRootFileInfo()
            
                err := filepath.WalkDir(sourceDir, func(path string, _ os.DirEntry, err error) error {
                    if err != nil {
            Severity: Major
            Found in pkg/archive/changes_other.go - About 50 mins to fix

              Method layerStore.ReleaseRWLayer has 8 return statements (exceeds 4 allowed).
              Open

              func (ls *layerStore) ReleaseRWLayer(l RWLayer) ([]Metadata, error) {
                  name := l.Name()
                  ls.locker.Lock(name)
                  defer ls.locker.Unlock(name)
              
              
              Severity: Major
              Found in layer/layer_store.go - About 50 mins to fix

                Function mkdirAs has 8 return statements (exceeds 4 allowed).
                Open

                func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error {
                    path, err := filepath.Abs(path)
                    if err != nil {
                        return err
                    }
                Severity: Major
                Found in pkg/idtools/idtools_unix.go - About 50 mins to fix

                  Method layerStore.loadLayer has 8 return statements (exceeds 4 allowed).
                  Open

                  func (ls *layerStore) loadLayer(layer ChainID) (*roLayer, error) {
                      cl, ok := ls.layerMap[layer]
                      if ok {
                          return cl, nil
                      }
                  Severity: Major
                  Found in layer/layer_store.go - About 50 mins to fix

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                        d.Lock()
                        defer d.Unlock()
                    
                        if d.network != "" {
                    Severity: Minor
                    Found in libnetwork/drivers/host/host.go and 1 other location - About 50 mins to fix
                    libnetwork/drivers/null/null.go on lines 41..52

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

                    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 3 locations. Consider refactoring.
                    Open

                        for name, node := range nDB.failedNodes {
                            if node.Addr.Equal(mn.Addr) && node.Port == mn.Port && mn.Name != name {
                                log.G(context.TODO()).Infof("Node %s/%s, is the new incarnation of the failed node %s/%s", mn.Name, mn.Addr, name, node.Addr)
                                nDB.changeNodeState(name, nodeLeftState)
                                return true
                    Severity: Major
                    Found in libnetwork/networkdb/nodemgmt.go and 2 other locations - About 50 mins to fix
                    libnetwork/networkdb/nodemgmt.go on lines 96..102
                    libnetwork/networkdb/nodemgmt.go on lines 112..118

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

                    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 2 locations. Consider refactoring.
                    Open

                    func (e *namesByContainerIDIndexer) FromArgs(args ...interface{}) ([]byte, error) {
                        if len(args) != 1 {
                            return nil, fmt.Errorf("must provide only a single argument")
                        }
                        arg, ok := args[0].(string)
                    Severity: Minor
                    Found in container/view.go and 1 other location - About 50 mins to fix
                    container/view.go on lines 479..489

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

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                        d.Lock()
                        defer d.Unlock()
                    
                        if d.network != "" {
                    Severity: Minor
                    Found in libnetwork/drivers/null/null.go and 1 other location - About 50 mins to fix
                    libnetwork/drivers/host/host.go on lines 41..52

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

                    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 3 locations. Consider refactoring.
                    Open

                        for name, node := range nDB.nodes {
                            if node.Addr.Equal(mn.Addr) && node.Port == mn.Port && mn.Name != name {
                                log.G(context.TODO()).Infof("Node %s/%s, is the new incarnation of the active node %s/%s", mn.Name, mn.Addr, name, node.Addr)
                                nDB.changeNodeState(name, nodeLeftState)
                                return true
                    Severity: Major
                    Found in libnetwork/networkdb/nodemgmt.go and 2 other locations - About 50 mins to fix
                    libnetwork/networkdb/nodemgmt.go on lines 104..110
                    libnetwork/networkdb/nodemgmt.go on lines 112..118

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

                    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 3 locations. Consider refactoring.
                    Open

                        for name, node := range nDB.leftNodes {
                            if node.Addr.Equal(mn.Addr) && node.Port == mn.Port && mn.Name != name {
                                log.G(context.TODO()).Infof("Node %s/%s, is the new incarnation of the shutdown node %s/%s", mn.Name, mn.Addr, name, node.Addr)
                                nDB.changeNodeState(name, nodeLeftState)
                                return true
                    Severity: Major
                    Found in libnetwork/networkdb/nodemgmt.go and 2 other locations - About 50 mins to fix
                    libnetwork/networkdb/nodemgmt.go on lines 96..102
                    libnetwork/networkdb/nodemgmt.go on lines 104..110

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

                    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 2 locations. Consider refactoring.
                    Open

                    func (e *namesByNameIndexer) FromArgs(args ...interface{}) ([]byte, error) {
                        if len(args) != 1 {
                            return nil, fmt.Errorf("must provide only a single argument")
                        }
                        arg, ok := args[0].(string)
                    Severity: Minor
                    Found in container/view.go and 1 other location - About 50 mins to fix
                    container/view.go on lines 504..514

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

                    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 2 locations. Consider refactoring.
                    Open

                    func (sr *swarmRouter) removeConfig(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
                        if err := sr.backend.RemoveConfig(vars["id"]); err != nil {
                            return err
                        }
                        w.WriteHeader(http.StatusNoContent)
                    Severity: Minor
                    Found in api/server/router/swarm/cluster_routes.go and 1 other location - About 50 mins to fix
                    api/server/router/swarm/cluster_routes.go on lines 455..462

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

                    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 2 locations. Consider refactoring.
                    Open

                    func ulimitsToGRPC(u []*container.Ulimit) []*swarmapi.ContainerSpec_Ulimit {
                        ulimits := make([]*swarmapi.ContainerSpec_Ulimit, len(u))
                    
                        for i, ulimit := range u {
                            ulimits[i] = &swarmapi.ContainerSpec_Ulimit{
                    Severity: Minor
                    Found in daemon/cluster/convert/container.go and 1 other location - About 50 mins to fix
                    daemon/cluster/convert/container.go on lines 546..558

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

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    package main
                    
                    import (
                        "net"
                        "net/http"
                    Severity: Minor
                    Found in integration/plugin/volumes/cmd/dummy/main.go and 1 other location - About 50 mins to fix
                    integration/plugin/logging/cmd/dummy/main.go on lines 1..21

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

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    package main
                    
                    import (
                        "net"
                        "net/http"
                    Severity: Minor
                    Found in integration/plugin/logging/cmd/dummy/main.go and 1 other location - About 50 mins to fix
                    integration/plugin/volumes/cmd/dummy/main.go on lines 1..21

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language