firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Method MySQL.collect has 5 return statements (exceeds 4 allowed).
Open

func (m *MySQL) collect() (map[string]int64, error) {
    if m.db == nil {
        if err := m.openConnection(); err != nil {
            return nil, err
        }
Severity: Major
Found in src/go/plugin/go.d/modules/mysql/collect.go - About 35 mins to fix

    Method uwsgiClient.queryStats has 5 return statements (exceeds 4 allowed).
    Open

    func (c *uwsgiClient) queryStats() ([]byte, error) {
        var b bytes.Buffer
        var n int64
        var err error
        const readLineLimit = 1000 * 10
    Severity: Major
    Found in src/go/plugin/go.d/modules/uwsgi/client.go - About 35 mins to fix

      Method Gearman.collectPriorityStatus has 5 return statements (exceeds 4 allowed).
      Open

      func (g *Gearman) collectPriorityStatus(mx map[string]int64, prioStatusData []byte) error {
          /*
              Same output as the "gearadmin --priority-status" command:
      
              FUNCTION\tHIGH\tNORMAL\tLOW\tAVAILABLE_WORKERS
      Severity: Major
      Found in src/go/plugin/go.d/modules/gearman/collect.go - About 35 mins to fix

        Function New has 5 return statements (exceeds 4 allowed).
        Open

        func New(config Config) (*Client, error) {
            ctx := context.Background()
            soapClient, err := newSoapClient(config)
            if err != nil {
                return nil, err
        Severity: Major
        Found in src/go/plugin/go.d/modules/vsphere/client/client.go - About 35 mins to fix

          Method Mongo.collectSharding has 5 return statements (exceeds 4 allowed).
          Open

          func (m *Mongo) collectSharding(mx map[string]int64) error {
              nodes, err := m.conn.shardNodes()
              if err != nil {
                  return err
              }
          Severity: Major
          Found in src/go/plugin/go.d/modules/mongodb/collect_sharding.go - About 35 mins to fix

            Method nvidiaSmiLoopExec.run has 5 return statements (exceeds 4 allowed).
            Open

            func (e *nvidiaSmiLoopExec) run() error {
                secs := 5
                if e.updateEvery < secs {
                    secs = e.updateEvery
                }
            Severity: Major
            Found in src/go/plugin/go.d/modules/nvidia_smi/exec.go - About 35 mins to fix

              Method Nginx.collect has 5 return statements (exceeds 4 allowed).
              Open

              func (n *Nginx) collect() (map[string]int64, error) {
                  req, err := web.NewHTTPRequest(n.RequestConfig)
                  if err != nil {
                      return nil, fmt.Errorf("failed to create HTTP request to '%s': %w'", n.URL, err)
                  }
              Severity: Major
              Found in src/go/plugin/go.d/modules/nginx/collect.go - About 35 mins to fix

                Method fromSMTP.certificates has 5 return statements (exceeds 4 allowed).
                Open

                func (f fromSMTP) certificates() ([]*x509.Certificate, error) {
                    ipConn, err := net.DialTimeout(f.url.Scheme, f.url.Host, f.timeout)
                    if err != nil {
                        return nil, fmt.Errorf("error on dial to '%s': %v", f.url, err)
                    }
                Severity: Major
                Found in src/go/plugin/go.d/modules/x509check/provider.go - About 35 mins to fix

                  Method RabbitMQ.collect has 5 return statements (exceeds 4 allowed).
                  Open

                  func (r *RabbitMQ) collect() (map[string]int64, error) {
                      mx := make(map[string]int64)
                  
                      if err := r.collectOverviewStats(mx); err != nil {
                          return nil, err
                  Severity: Major
                  Found in src/go/plugin/go.d/modules/rabbitmq/collect.go - About 35 mins to fix

                    Function addRespCodesCharts has 5 return statements (exceeds 4 allowed).
                    Open

                    func addRespCodesCharts(charts *Charts, group bool) error {
                        if err := charts.Add(reqTypes.Copy()); err != nil {
                            return err
                        }
                        if err := charts.Add(respCodeClass.Copy()); err != nil {
                    Severity: Major
                    Found in src/go/plugin/go.d/modules/weblog/charts.go - About 35 mins to fix

                      Function addReqProcTimeCharts has 5 return statements (exceeds 4 allowed).
                      Open

                      func addReqProcTimeCharts(charts *Charts, histogram []float64, patterns []userPattern) error {
                          if err := charts.Add(reqProcTime.Copy()); err != nil {
                              return err
                          }
                          for _, p := range patterns {
                      Severity: Major
                      Found in src/go/plugin/go.d/modules/weblog/charts.go - About 35 mins to fix

                        Method Gearman.collectStatus has 5 return statements (exceeds 4 allowed).
                        Open

                        func (g *Gearman) collectStatus(mx map[string]int64, statusData []byte) error {
                            /*
                                Same output as the "gearadmin --status" command:
                        
                                FUNCTION\tTOTAL\tRUNNING\tAVAILABLE_WORKERS
                        Severity: Major
                        Found in src/go/plugin/go.d/modules/gearman/collect.go - About 35 mins to fix

                          Method HTTPCheck.readCookieFile has 5 return statements (exceeds 4 allowed).
                          Open

                          func (hc *HTTPCheck) readCookieFile() error {
                              if hc.CookieFile == "" {
                                  return nil
                              }
                          
                          
                          Severity: Major
                          Found in src/go/plugin/go.d/modules/httpcheck/collect.go - About 35 mins to fix

                            Method apcupsdClient.receive has 5 return statements (exceeds 4 allowed).
                            Open

                            func (c *apcupsdClient) receive() ([]byte, error) {
                                // https://github.com/therealbstern/apcupsd/blob/224d19d5faa508d04267f6135fe53d50800550de/src/apcnis.c#L54
                            
                                var buf bytes.Buffer
                                msgLength := make([]byte, 2)
                            Severity: Major
                            Found in src/go/plugin/go.d/modules/apcupsd/client.go - About 35 mins to fix

                              Method Lighttpd.collect has 5 return statements (exceeds 4 allowed).
                              Open

                              func (l *Lighttpd) collect() (map[string]int64, error) {
                                  req, err := web.NewHTTPRequest(l.RequestConfig)
                                  if err != nil {
                                      return nil, fmt.Errorf("failed to create HTTP request: %v", err)
                                  }
                              Severity: Major
                              Found in src/go/plugin/go.d/modules/lighttpd/collect.go - About 35 mins to fix

                                Function newCustomTimeFieldCharts has 5 return statements (exceeds 4 allowed).
                                Open

                                func newCustomTimeFieldCharts(fields []customTimeField) (Charts, error) {
                                    charts := Charts{}
                                    for i, f := range fields {
                                        chartTime, err := newCustomTimeFieldChart(f)
                                        if err != nil {
                                Severity: Major
                                Found in src/go/plugin/go.d/modules/weblog/charts.go - About 35 mins to fix

                                  Method mongoClient.shardChunks has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (c *mongoClient) shardChunks() (map[string]int64, error) {
                                      ctx, cancel := context.WithTimeout(context.Background(), c.timeout)
                                      defer cancel()
                                  
                                      col := c.client.Database("config").Collection("chunks")
                                  Severity: Major
                                  Found in src/go/plugin/go.d/modules/mongodb/client.go - About 35 mins to fix

                                    Method boincClient.authenticate has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (c *boincClient) authenticate() error {
                                        // https://boinc.berkeley.edu/trac/wiki/GuiRpcProtocol#Authentication
                                    
                                        req := &boincRequest{
                                            Auth1: &struct{}{},
                                    Severity: Major
                                    Found in src/go/plugin/go.d/modules/boinc/client.go - About 35 mins to fix

                                      Method Smartctl.collectScannedDevice has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (s *Smartctl) collectScannedDevice(mx map[string]int64, scanDev *scanDevice) error {
                                          resp, err := s.exec.deviceInfo(scanDev.name, scanDev.typ, s.NoCheckPowerMode)
                                          if err != nil {
                                              if resp != nil && isDeviceOpenFailedNoSuchDevice(resp) && !scanDev.extra {
                                                  s.Infof("smartctl reported that device '%s' type '%s' no longer exists", scanDev.name, scanDev.typ)
                                      Severity: Major
                                      Found in src/go/plugin/go.d/modules/smartctl/collect.go - About 35 mins to fix

                                        Method VSphere.Init has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func (vs *VSphere) Init() error {
                                            if err := vs.validateConfig(); err != nil {
                                                vs.Errorf("error on validating config: %v", err)
                                                return err
                                            }
                                        Severity: Major
                                        Found in src/go/plugin/go.d/modules/vsphere/vsphere.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language