portainer/portainer

View on GitHub
api/docker/images/status.go

Summary

Maintainability
A
1 hr
Test Coverage

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

func FigureOut(statuses []Status) Status {
    if allMatch(statuses, Skipped) {
        return Skipped
    }

Severity: Major
Found in api/docker/images/status.go - About 40 mins to fix

    Method DigestClient.ServiceImageStatus has 5 return statements (exceeds 4 allowed).
    Open

    func (c *DigestClient) ServiceImageStatus(ctx context.Context, serviceID string, endpoint *portainer.Endpoint) (Status, error) {
        cli, err := c.clientFactory.CreateClient(endpoint, "", nil)
        if err != nil {
            return Error, nil
        }
    Severity: Major
    Found in api/docker/images/status.go - About 35 mins to fix

      Method DigestClient.ContainerImageStatus has 5 return statements (exceeds 4 allowed).
      Open

      func (c *DigestClient) ContainerImageStatus(ctx context.Context, containerID string, endpoint *portainer.Endpoint, nodeName string) (Status, error) {
          cli, err := c.clientFactory.CreateClient(endpoint, nodeName, nil)
          if err != nil {
              log.Warn().Str("swarmNodeId", nodeName).Msg("Cannot create new docker client.")
          }
      Severity: Major
      Found in api/docker/images/status.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status