portainer/portainer

View on GitHub
api/http/handler/registries/registry_create.go

Summary

Maintainability
A
1 hr
Test Coverage

Method Handler.registryCreate has 8 return statements (exceeds 4 allowed).
Open

func (handler *Handler) registryCreate(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
    securityContext, err := security.RetrieveRestrictedRequestContext(r)
    if err != nil {
        return httperror.InternalServerError("Unable to retrieve info from request context", err)
    }
Severity: Major
Found in api/http/handler/registries/registry_create.go - About 50 mins to fix

    Method registryCreatePayload.Validate has 6 return statements (exceeds 4 allowed).
    Open

    func (payload *registryCreatePayload) Validate(_ *http.Request) error {
        if govalidator.IsNull(payload.Name) {
            return errors.New("Invalid registry name")
        }
        if govalidator.IsNull(payload.URL) {
    Severity: Major
    Found in api/http/handler/registries/registry_create.go - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status