portainer/portainer

View on GitHub
api/http/handler/endpoints/endpoint_registry_access.go

Summary

Maintainability
A
1 hr
Test Coverage

Method Handler.updateRegistryAccess has 10 return statements (exceeds 4 allowed).
Open

func (handler *Handler) updateRegistryAccess(tx dataservices.DataStoreTx, r *http.Request, endpointID portainer.EndpointID, registryID portainer.RegistryID) error {
    endpoint, err := tx.Endpoint().Endpoint(endpointID)
    if tx.IsErrObjectNotFound(err) {
        return httperror.NotFound("Unable to find an environment with the specified identifier inside the database", err)
    } else if err != nil {
Severity: Major
Found in api/http/handler/endpoints/endpoint_registry_access.go - About 1 hr to fix

    Method Handler.endpointRegistryAccess has 6 return statements (exceeds 4 allowed).
    Open

    func (handler *Handler) endpointRegistryAccess(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
        endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
        if err != nil {
            return httperror.BadRequest("Invalid environment identifier route variable", err)
        }
    Severity: Major
    Found in api/http/handler/endpoints/endpoint_registry_access.go - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status