dotcloud/docker

View on GitHub
daemon/container_operations_windows.go

Summary

Maintainability
A
2 hrs
Test Coverage

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

func (daemon *Daemon) setupSecretDir(ctr *container.Container) (setupErr error) {
    if len(ctr.SecretReferences) == 0 {
        return nil
    }

Severity: Major
Found in daemon/container_operations_windows.go - About 50 mins to fix

    Method Daemon.initializeNetworkingPaths has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
    Open

    func (daemon *Daemon) initializeNetworkingPaths(ctr *container.Container, nc *container.Container) error {
        if nc.HostConfig.Isolation.IsHyperV() {
            return fmt.Errorf("sharing of hyperv containers network is not supported")
        }
    
    
    Severity: Minor
    Found in daemon/container_operations_windows.go - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method Daemon.setupConfigDir has 7 return statements (exceeds 4 allowed).
    Open

    func (daemon *Daemon) setupConfigDir(ctr *container.Container) (setupErr error) {
        if len(ctr.ConfigReferences) == 0 {
            return nil
        }
    
    
    Severity: Major
    Found in daemon/container_operations_windows.go - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status