docker/swarmkit

View on GitHub
api/genericresource/validate.go

Summary

Maintainability
A
1 hr
Test Coverage

Function HasResource has 6 return statements (exceeds 4 allowed).
Open

func HasResource(res *api.GenericResource, resources []*api.GenericResource) bool {
    for _, r := range resources {
        if Kind(res) != Kind(r) {
            continue
        }
Severity: Major
Found in api/genericresource/validate.go - About 40 mins to fix

    Function HasEnough has 6 return statements (exceeds 4 allowed).
    Open

    func HasEnough(nodeRes []*api.GenericResource, taskRes *api.GenericResource) (bool, error) {
        t := taskRes.GetDiscreteResourceSpec()
        if t == nil {
            return false, fmt.Errorf("task should only hold Discrete type")
        }
    Severity: Major
    Found in api/genericresource/validate.go - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status