container/state.go
State
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type State struct {
// This Mutex is exported by design and is used as a global lock
// for both the State and the Container it's embedded in.
sync.Mutex
// Note that `Running` and `Paused` are not mutually exclusive:
Consider simplifying this complex logical expression. Open
Open
if s != "paused" &&
s != "restarting" &&
s != "removing" &&
s != "running" &&
s != "dead" &&
Method State.String
has 9 return statements (exceeds 4 allowed). Open
Open
func (s *State) String() string {
if s.Running {
if s.Paused {
return fmt.Sprintf("Up %s (Paused)", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt)))
}
Method State.StateString
has 7 return statements (exceeds 4 allowed). Open
Open
func (s *State) StateString() string {
if s.Running {
if s.Paused {
return "paused"
}