portainer/portainer

View on GitHub
api/http/handler/endpointedge/endpointedge_status_inspect.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method Handler.inspectStatus has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (handler *Handler) inspectStatus(tx dataservices.DataStoreTx, r *http.Request, endpointID portainer.EndpointID) (*endpointEdgeStatusInspectResponse, error) {
    endpoint, err := tx.Endpoint().Endpoint(endpointID)
    if err != nil {
        return nil, err
    }
Severity: Minor
Found in api/http/handler/endpointedge/endpointedge_status_inspect.go - About 1 hr to fix

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

    func (handler *Handler) endpointEdgeStatusInspect(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/endpointedge/endpointedge_status_inspect.go - About 1 hr to fix

      Method Handler.inspectStatus has 7 return statements (exceeds 4 allowed).
      Open

      func (handler *Handler) inspectStatus(tx dataservices.DataStoreTx, r *http.Request, endpointID portainer.EndpointID) (*endpointEdgeStatusInspectResponse, error) {
          endpoint, err := tx.Endpoint().Endpoint(endpointID)
          if err != nil {
              return nil, err
          }
      Severity: Major
      Found in api/http/handler/endpointedge/endpointedge_status_inspect.go - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status