dotcloud/docker

View on GitHub
daemon/container.go

Summary

Maintainability
A
3 hrs
Test Coverage

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 Daemon.newContainer has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (daemon *Daemon) newContainer(name string, operatingSystem string, config *containertypes.Config, hostConfig *containertypes.HostConfig, imgID image.ID, managed bool) (*container.Container, error) {
    Severity: Minor
    Found in daemon/container.go - About 45 mins to fix

      Function validateHealthCheck has 7 return statements (exceeds 4 allowed).
      Open

      func validateHealthCheck(healthConfig *containertypes.HealthConfig) error {
          if healthConfig == nil {
              return nil
          }
          if healthConfig.Interval != 0 && healthConfig.Interval < containertypes.MinimumDuration {
      Severity: Major
      Found in daemon/container.go - About 45 mins to fix

        Method Daemon.GetContainer has 6 return statements (exceeds 4 allowed).
        Open

        func (daemon *Daemon) GetContainer(prefixOrName string) (*container.Container, error) {
            if len(prefixOrName) == 0 {
                return nil, errors.WithStack(invalidIdentifier(prefixOrName))
            }
        
        
        Severity: Major
        Found in daemon/container.go - About 40 mins to fix

          Function validateContainerConfig has 5 return statements (exceeds 4 allowed).
          Open

          func validateContainerConfig(config *containertypes.Config) error {
              if config == nil {
                  return nil
              }
              if err := translateWorkingDir(config); err != nil {
          Severity: Major
          Found in daemon/container.go - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status