firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

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

func (e *intelGpuTopExec) run() error {
    var cmd *exec.Cmd

    if e.device != "" {
        cmd = exec.Command(e.ndsudoPath, "igt-device-json", "--interval", e.calcIntervalArg(), "--device", e.device)
Severity: Major
Found in src/go/plugin/go.d/modules/intelgpu/exec.go - About 35 mins to fix

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

    func (b *Bind) Init() error {
        if err := b.validateConfig(); err != nil {
            b.Errorf("config verification: %v", err)
            return err
        }
    Severity: Major
    Found in src/go/plugin/go.d/modules/bind/bind.go - About 35 mins to fix

      Method Sensors.relabel has 5 return statements (exceeds 4 allowed).
      Open

      func (s *Sensors) relabel(chipUniqueName, snName string) string {
          for _, rv := range s.Relabel {
              if rv.Chip == "" {
                  return ""
              }
      Severity: Major
      Found in src/go/plugin/go.d/modules/sensors/charts.go - About 35 mins to fix

        Method PgBouncer.queryVersion has 5 return statements (exceeds 4 allowed).
        Open

        func (p *PgBouncer) queryVersion() (*semver.Version, error) {
            q := queryShowVersion
            p.Debugf("executing query: %v", q)
        
            var resp string
        Severity: Major
        Found in src/go/plugin/go.d/modules/pgbouncer/collect.go - About 35 mins to fix

          Method logLine.assignVhostWithPort has 5 return statements (exceeds 4 allowed).
          Open

          func (l *logLine) assignVhostWithPort(vhostPort string) error {
              if vhostPort == hyphen {
                  return nil
              }
              idx := strings.LastIndexByte(vhostPort, ':')
          Severity: Major
          Found in src/go/plugin/go.d/modules/weblog/logline.go - About 35 mins to fix

            Method configComposer.parseTemplateData has 5 return statements (exceeds 4 allowed).
            Open

            func (c *configComposer) parseTemplateData(bs []byte) ([]confgroup.Config, error) {
                var data any
                if err := yaml.Unmarshal(bs, &data); err != nil {
                    return nil, err
                }
            Severity: Major
            Found in src/go/plugin/go.d/agent/discovery/sd/pipeline/compose.go - About 35 mins to fix

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

              func validateConfig(cfg Config) error {
                  if cfg.Name == "" {
                      return errors.New("'name' not set")
                  }
                  if err := validateDiscoveryConfig(cfg.Discover); err != nil {
              Severity: Major
              Found in src/go/plugin/go.d/agent/discovery/sd/pipeline/config.go - About 35 mins to fix

                Method Prometheus.initPrometheusClient has 5 return statements (exceeds 4 allowed).
                Open

                func (p *Prometheus) initPrometheusClient() (prometheus.Prometheus, error) {
                    httpClient, err := web.NewHTTPClient(p.ClientConfig)
                    if err != nil {
                        return nil, fmt.Errorf("init HTTP client: %v", err)
                    }
                Severity: Major
                Found in src/go/plugin/go.d/modules/prometheus/init.go - About 35 mins to fix

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

                  func (l *Litespeed) collect() (map[string]int64, error) {
                      if l.checkDir {
                          _, err := os.Stat(l.ReportsDir)
                          if err != nil {
                              return nil, err
                  Severity: Major
                  Found in src/go/plugin/go.d/modules/litespeed/collect.go - About 35 mins to fix

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

                    func parseResponseLine(line string) (string, int, error) {
                        parts := strings.Fields(line)
                        if len(parts) == 0 {
                            return "", 0, errors.New("empty response")
                        }
                    Severity: Major
                    Found in src/go/plugin/go.d/modules/beanstalk/client.go - About 35 mins to fix

                      Method Discoverer.parseLocalListeners has 5 return statements (exceeds 4 allowed).
                      Open

                      func (d *Discoverer) parseLocalListeners(bs []byte) ([]model.Target, error) {
                          const (
                              local4 = "127.0.0.1"
                              local6 = "::1"
                          )

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

                        func New(cfg Config) (*Pipeline, error) {
                            if err := validateConfig(cfg); err != nil {
                                return nil, err
                            }
                        
                        
                        Severity: Major
                        Found in src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline.go - About 35 mins to fix

                          Method DHCPd.validateConfig has 5 return statements (exceeds 4 allowed).
                          Open

                          func (d *DHCPd) validateConfig() error {
                              if d.Config.LeasesPath == "" {
                                  return errors.New("'lease_path' parameter not set")
                              }
                              if len(d.Config.Pools) == 0 {
                          Severity: Major
                          Found in src/go/plugin/go.d/modules/isc_dhcpd/init.go - About 35 mins to fix

                            Method Pipeline.registerDiscoverers has 5 return statements (exceeds 4 allowed).
                            Open

                            func (p *Pipeline) registerDiscoverers(conf Config) error {
                                for _, cfg := range conf.Discover {
                                    switch cfg.Discoverer {
                                    case "net_listeners":
                                        cfg.NetListeners.Source = conf.Source
                            Severity: Major
                            Found in src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline.go - About 35 mins to fix

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

                              func parseZpoolListVdevOutput(bs []byte) ([]vdevEntry, error) {
                                  var headers []string
                                  var vdevs []vdevEntry
                                  sc := bufio.NewScanner(bytes.NewReader(bs))
                              
                              
                              Severity: Major
                              Found in src/go/plugin/go.d/modules/zfspool/collect_zpool_list_vdev.go - About 35 mins to fix

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

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

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

                                  func parseSingleSelectorWord(word string) (selector, error) {
                                      if len(word) == 0 {
                                          return nil, errors.New("empty word")
                                      }
                                      neg := word[0] == '!'
                                  Severity: Major
                                  Found in src/go/plugin/go.d/agent/discovery/sd/pipeline/selector.go - About 35 mins to fix

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

                                    func newClassifyRules(cfg []ClassifyRuleConfig) ([]*classifyRule, error) {
                                        var rules []*classifyRule
                                    
                                        fmap := newFuncMap()
                                    
                                    
                                    Severity: Major
                                    Found in src/go/plugin/go.d/agent/discovery/sd/pipeline/classify.go - About 35 mins to fix

                                      Method NginxVTS.initCharts has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (vts *NginxVTS) initCharts() (*module.Charts, error) {
                                          charts := module.Charts{}
                                      
                                          if err := charts.Add(*mainCharts.Copy()...); err != nil {
                                              return nil, err
                                      Severity: Major
                                      Found in src/go/plugin/go.d/modules/nginxvts/init.go - About 35 mins to fix

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

                                        func scanUDPPort(address string, timeout time.Duration) (bool, error) {
                                            // With this scan type, we send 0-byte UDP packets to the port on the target system.
                                            // Receipt of an ICMP Destination Unreachable message signifies the port is closed;
                                            // otherwise it is assumed open (timeout).
                                            // This is equivalent to "close"/"open/filtered" states reported by nmap.
                                        Severity: Major
                                        Found in src/go/plugin/go.d/modules/portcheck/check_udp_port.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language