xmidt-org/heimdall

View on GitHub

Showing 5 of 5 total issues

Function populate has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

func populate(conn deviceGetter, window time.Duration, windowLimit int, shuffler shuffle.Interface, stop chan struct{}, wg *sync.WaitGroup, measures *Measures) {
Severity: Major
Found in main.go - About 50 mins to fix

    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

      Function setup has 6 return statements (exceeds 4 allowed).
      Open

      func setup(arguments []string) (*server.WebPA, *cassandra.Connection, *Confidence, *StatusConfig, xmetrics.Registry, log.Logger, *int) {
          var (
              s                 *int
              f, v              = pflag.NewFlagSet(applicationName, pflag.ContinueOnError), viper.New()
              l, mr, codex, err = server.Initialize(applicationName, arguments, f, v, cassandra.Metrics, Metrics, shuffle.Metrics)
      Severity: Major
      Found in main.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
            Severity
            Category
            Status
            Source
            Language