Showing 1,088 of 2,665 total issues
Method MySQL.collect
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *MySQL) collect() (map[string]int64, error) {
if m.db == nil {
if err := m.openConnection(); err != nil {
return nil, err
}
Method uwsgiClient.queryStats
has 5 return statements (exceeds 4 allowed). Open
Open
func (c *uwsgiClient) queryStats() ([]byte, error) {
var b bytes.Buffer
var n int64
var err error
const readLineLimit = 1000 * 10
Method Gearman.collectPriorityStatus
has 5 return statements (exceeds 4 allowed). Open
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
Function New
has 5 return statements (exceeds 4 allowed). Open
Open
func New(config Config) (*Client, error) {
ctx := context.Background()
soapClient, err := newSoapClient(config)
if err != nil {
return nil, err
Method Mongo.collectSharding
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *Mongo) collectSharding(mx map[string]int64) error {
nodes, err := m.conn.shardNodes()
if err != nil {
return err
}
Method nvidiaSmiLoopExec.run
has 5 return statements (exceeds 4 allowed). Open
Open
func (e *nvidiaSmiLoopExec) run() error {
secs := 5
if e.updateEvery < secs {
secs = e.updateEvery
}
Method Nginx.collect
has 5 return statements (exceeds 4 allowed). Open
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)
}
Method fromSMTP.certificates
has 5 return statements (exceeds 4 allowed). Open
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)
}
Method RabbitMQ.collect
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *RabbitMQ) collect() (map[string]int64, error) {
mx := make(map[string]int64)
if err := r.collectOverviewStats(mx); err != nil {
return nil, err
Function addRespCodesCharts
has 5 return statements (exceeds 4 allowed). Open
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 {
Function addReqProcTimeCharts
has 5 return statements (exceeds 4 allowed). Open
Open
func addReqProcTimeCharts(charts *Charts, histogram []float64, patterns []userPattern) error {
if err := charts.Add(reqProcTime.Copy()); err != nil {
return err
}
for _, p := range patterns {
Method Gearman.collectStatus
has 5 return statements (exceeds 4 allowed). Open
Open
func (g *Gearman) collectStatus(mx map[string]int64, statusData []byte) error {
/*
Same output as the "gearadmin --status" command:
FUNCTION\tTOTAL\tRUNNING\tAVAILABLE_WORKERS
Method HTTPCheck.readCookieFile
has 5 return statements (exceeds 4 allowed). Open
Open
func (hc *HTTPCheck) readCookieFile() error {
if hc.CookieFile == "" {
return nil
}
Method apcupsdClient.receive
has 5 return statements (exceeds 4 allowed). Open
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)
Method Lighttpd.collect
has 5 return statements (exceeds 4 allowed). Open
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)
}
Function newCustomTimeFieldCharts
has 5 return statements (exceeds 4 allowed). Open
Open
func newCustomTimeFieldCharts(fields []customTimeField) (Charts, error) {
charts := Charts{}
for i, f := range fields {
chartTime, err := newCustomTimeFieldChart(f)
if err != nil {
Method mongoClient.shardChunks
has 5 return statements (exceeds 4 allowed). Open
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")
Method boincClient.authenticate
has 5 return statements (exceeds 4 allowed). Open
Open
func (c *boincClient) authenticate() error {
// https://boinc.berkeley.edu/trac/wiki/GuiRpcProtocol#Authentication
req := &boincRequest{
Auth1: &struct{}{},
Method Smartctl.collectScannedDevice
has 5 return statements (exceeds 4 allowed). Open
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)
Method VSphere.Init
has 5 return statements (exceeds 4 allowed). Open
Open
func (vs *VSphere) Init() error {
if err := vs.validateConfig(); err != nil {
vs.Errorf("error on validating config: %v", err)
return err
}