Showing 1,088 of 2,665 total issues
Method intelGpuTopExec.run
has 5 return statements (exceeds 4 allowed). Open
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)
Method Bind.Init
has 5 return statements (exceeds 4 allowed). Open
Open
func (b *Bind) Init() error {
if err := b.validateConfig(); err != nil {
b.Errorf("config verification: %v", err)
return err
}
Method Sensors.relabel
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *Sensors) relabel(chipUniqueName, snName string) string {
for _, rv := range s.Relabel {
if rv.Chip == "" {
return ""
}
Method PgBouncer.queryVersion
has 5 return statements (exceeds 4 allowed). Open
Open
func (p *PgBouncer) queryVersion() (*semver.Version, error) {
q := queryShowVersion
p.Debugf("executing query: %v", q)
var resp string
Method logLine.assignVhostWithPort
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *logLine) assignVhostWithPort(vhostPort string) error {
if vhostPort == hyphen {
return nil
}
idx := strings.LastIndexByte(vhostPort, ':')
Method configComposer.parseTemplateData
has 5 return statements (exceeds 4 allowed). Open
Open
func (c *configComposer) parseTemplateData(bs []byte) ([]confgroup.Config, error) {
var data any
if err := yaml.Unmarshal(bs, &data); err != nil {
return nil, err
}
Function validateConfig
has 5 return statements (exceeds 4 allowed). Open
Open
func validateConfig(cfg Config) error {
if cfg.Name == "" {
return errors.New("'name' not set")
}
if err := validateDiscoveryConfig(cfg.Discover); err != nil {
Method Prometheus.initPrometheusClient
has 5 return statements (exceeds 4 allowed). Open
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)
}
Method Litespeed.collect
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *Litespeed) collect() (map[string]int64, error) {
if l.checkDir {
_, err := os.Stat(l.ReportsDir)
if err != nil {
return nil, err
Function parseResponseLine
has 5 return statements (exceeds 4 allowed). Open
Open
func parseResponseLine(line string) (string, int, error) {
parts := strings.Fields(line)
if len(parts) == 0 {
return "", 0, errors.New("empty response")
}
Method Discoverer.parseLocalListeners
has 5 return statements (exceeds 4 allowed). Open
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
Open
func New(cfg Config) (*Pipeline, error) {
if err := validateConfig(cfg); err != nil {
return nil, err
}
Method DHCPd.validateConfig
has 5 return statements (exceeds 4 allowed). Open
Open
func (d *DHCPd) validateConfig() error {
if d.Config.LeasesPath == "" {
return errors.New("'lease_path' parameter not set")
}
if len(d.Config.Pools) == 0 {
Method Pipeline.registerDiscoverers
has 5 return statements (exceeds 4 allowed). Open
Open
func (p *Pipeline) registerDiscoverers(conf Config) error {
for _, cfg := range conf.Discover {
switch cfg.Discoverer {
case "net_listeners":
cfg.NetListeners.Source = conf.Source
Function parseZpoolListVdevOutput
has 5 return statements (exceeds 4 allowed). Open
Open
func parseZpoolListVdevOutput(bs []byte) ([]vdevEntry, error) {
var headers []string
var vdevs []vdevEntry
sc := bufio.NewScanner(bytes.NewReader(bs))
Method Tengine.collect
has 5 return statements (exceeds 4 allowed). Open
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)
}
Function parseSingleSelectorWord
has 5 return statements (exceeds 4 allowed). Open
Open
func parseSingleSelectorWord(word string) (selector, error) {
if len(word) == 0 {
return nil, errors.New("empty word")
}
neg := word[0] == '!'
Function newClassifyRules
has 5 return statements (exceeds 4 allowed). Open
Open
func newClassifyRules(cfg []ClassifyRuleConfig) ([]*classifyRule, error) {
var rules []*classifyRule
fmap := newFuncMap()
Method NginxVTS.initCharts
has 5 return statements (exceeds 4 allowed). Open
Open
func (vts *NginxVTS) initCharts() (*module.Charts, error) {
charts := module.Charts{}
if err := charts.Add(*mainCharts.Copy()...); err != nil {
return nil, err
Function scanUDPPort
has 5 return statements (exceeds 4 allowed). Open
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.