xmidt-org/heimdall

View on GitHub
confidence.go

Summary

Maintainability
A
1 hr
Test Coverage

Method Confidence.codexOnline has 6 return statements (exceeds 4 allowed).
Open

func (confidence *Confidence) codexOnline(device string) bool {
    request, err := http.NewRequest("GET", confidence.codexAddress+"/api/v1/device/"+device+"/status", nil)
    if err != nil {
        logging.Error(confidence.logger).Log(logging.ErrorKey(), err, logging.MessageKey(), "failed to create request")
        return false
Severity: Major
Found in confidence.go - About 40 mins to fix

    Method Confidence.xmidtOnline has 5 return statements (exceeds 4 allowed).
    Open

    func (confidence *Confidence) xmidtOnline(device string) bool {
        request, err := http.NewRequest("GET", confidence.xmidtAddress+"/api/v2/device/"+device+"/stat", nil)
        if err != nil {
            logging.Error(confidence.logger).Log(logging.ErrorKey(), err, logging.MessageKey(), "failed to create request")
            return false
    Severity: Major
    Found in confidence.go - About 35 mins to fix

      Method Confidence.doRequest has 5 return statements (exceeds 4 allowed).
      Open

      func (confidence *Confidence) doRequest(request *http.Request) (int, []byte, error) {
          retryOptions := xhttp.RetryOptions{
              Logger:  confidence.logger,
              Retries: 3,
      
      
      Severity: Major
      Found in confidence.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status