xmidt-org/caduceus

View on GitHub
httpClient.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function getDoErrReason has 13 return statements (exceeds 4 allowed).
Open

func getDoErrReason(err error) string {
    var d *net.DNSError
    if err == nil {
        return noErrReason
    } else if errors.Is(err, context.DeadlineExceeded) {
Severity: Major
Found in httpClient.go - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

        } else if errors.Is(err, &net.ParseError{}) {
            return parseAddrErrReason
        } else if errors.Is(err, net.InvalidAddrError("")) {
            return invalidAddrReason
        } else if errors.As(err, &d) {
    Severity: Major
    Found in httpClient.go - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status