dotcloud/docker

View on GitHub
daemon/health.go

Summary

Maintainability
B
5 hrs
Test Coverage

Method cmdProbe.run has 94 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*types.HealthcheckResult, error) {
    startTime := time.Now()
    cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
    if p.shell {
        cmdSlice = append(getShell(cntr), cmdSlice...)
Severity: Major
Found in daemon/health.go - About 2 hrs to fix

    Function monitor has 62 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func monitor(d *Daemon, c *container.Container, stop chan struct{}, probe probe) {
        probeInterval := timeoutWithDefault(c.Config.Healthcheck.Interval, defaultProbeInterval)
        startInterval := timeoutWithDefault(c.Config.Healthcheck.StartInterval, defaultStartInterval)
        startPeriod := timeoutWithDefault(c.Config.Healthcheck.StartPeriod, defaultStartPeriod)
    
    
    Severity: Minor
    Found in daemon/health.go - About 1 hr to fix

      Method cmdProbe.run has 10 return statements (exceeds 4 allowed).
      Open

      func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*types.HealthcheckResult, error) {
          startTime := time.Now()
          cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
          if p.shell {
              cmdSlice = append(getShell(cntr), cmdSlice...)
      Severity: Major
      Found in daemon/health.go - About 1 hr to fix

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

        func monitor(d *Daemon, c *container.Container, stop chan struct{}, probe probe) {
            probeInterval := timeoutWithDefault(c.Config.Healthcheck.Interval, defaultProbeInterval)
            startInterval := timeoutWithDefault(c.Config.Healthcheck.StartInterval, defaultStartInterval)
            startPeriod := timeoutWithDefault(c.Config.Healthcheck.StartPeriod, defaultStartPeriod)
        
        
        Severity: Major
        Found in daemon/health.go - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status