daemon/health.go
Method cmdProbe.run
has 94 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*containertypes.HealthcheckResult, error) {
startTime := time.Now()
cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
if p.shell {
cmdSlice = append(getShell(cntr), cmdSlice...)
Function monitor
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
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)
Method cmdProbe.run
has 10 return statements (exceeds 4 allowed). Open
Open
func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*containertypes.HealthcheckResult, error) {
startTime := time.Now()
cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
if p.shell {
cmdSlice = append(getShell(cntr), cmdSlice...)
Function monitor
has 5 return statements (exceeds 4 allowed). Open
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)