portainer/portainer

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

Summary

Maintainability
A
1 hr
Test Coverage

Method Handler.endpointSettingsUpdate has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (handler *Handler) endpointSettingsUpdate(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: Minor
Found in api/http/handler/endpoints/endpoint_settings_update.go - About 1 hr to fix

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

    func (handler *Handler) endpointSettingsUpdate(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_settings_update.go - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status