portainer/portainer

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

Summary

Maintainability
A
1 hr
Test Coverage

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

func (handler *Handler) endpointEdgeJobsLogs(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
    endpoint, err := middlewares.FetchEndpoint(r)
    if err != nil {
        return httperror.BadRequest("Unable to find an environment on request context", err)
    }
Severity: Major
Found in api/http/handler/endpointedge/endpointedge_job_logs.go - About 50 mins to fix

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

    func (handler *Handler) getEdgeJobLobs(tx dataservices.DataStoreTx, endpointID portainer.EndpointID, edgeJobID portainer.EdgeJobID, payload logsPayload) 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/endpointedge/endpointedge_job_logs.go - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status