Showing 1,088 of 2,665 total issues
Method Job.createChart
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (j *Job) createChart(chart *Chart) {
defer func() { chart.created = true }()
if chart.ignore {
return
}
Method Cassandra.collectClientRequestMetrics
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *Cassandra) collectClientRequestMetrics(pms prometheus.Series) {
const metric = "org_apache_cassandra_metrics_clientrequest"
var rw struct{ read, write *metricValue }
for _, pm := range pms.FindByName(metric + suffixCount) {
Method Smartctl.collectSmartDevice
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (s *Smartctl) collectSmartDevice(mx map[string]int64, dev *smartDevice) {
px := fmt.Sprintf("device_%s_type_%s_", dev.deviceName(), dev.deviceType())
if v, ok := dev.powerOnTime(); ok {
mx[px+"power_on_time"] = v
Function d3pieInitialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NETDATA.d3pieInitialize = function (callback) {
if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
// d3pie requires D3
if (!NETDATA.chartLibraries.d3.initialized) {
Function getLocaleString
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLocaleString: function (min, max) {
let key = max;
if (min === max) {
if (typeof this.formattersFixed[key] === 'undefined') {
this.formattersFixed[key] = {
Function getLocaleString
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLocaleString: function (min, max) {
let key = max;
if (min === max) {
if (typeof this.formattersFixed[key] === 'undefined') {
this.formattersFixed[key] = {
Function d3pieInitialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NETDATA.d3pieInitialize = function (callback) {
if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
// d3pie requires D3
if (!NETDATA.chartLibraries.d3.initialized) {
Method logLine.verify
has 16 return statements (exceeds 4 allowed). Open
Open
func (l *logLine) verify() error {
if l.empty() {
return fmt.Errorf("verify: %w", errEmptyLine)
}
if l.hasRespCode() && !l.isRespCodeValid() {
Method WebLog.createCharts
has 16 return statements (exceeds 4 allowed). Open
Open
func (w *WebLog) createCharts(line *logLine) error {
if line.empty() {
return errors.New("empty line")
}
w.charts = nil
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, total=10, connect=None, read=None, redirect=None, status=None,
Method Prometheus.addHistogramCharts
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p *Prometheus) addHistogramCharts(id, name, help string, labels labels.Labels, buckets []prometheus.Bucket) {
units := getChartUnits(name)
switch units {
case "seconds", "time":
Method Prometheus.addSummaryCharts
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p *Prometheus) addSummaryCharts(id, name, help string, labels labels.Labels, quantiles []prometheus.Quantile) {
units := getChartUnits(name)
switch units {
case "seconds", "time":
Method NginxPlus.queryAvailableEndpoints
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (n *NginxPlus) queryAvailableEndpoints() error {
req, _ := web.NewHTTPRequestWithPath(n.RequestConfig, fmt.Sprintf(urlPathAPIEndpointsRoot, n.apiVersion))
var endpoints []string
if err := n.doHTTP(req, &endpoints); err != nil {
Method MySQL.collect
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (m *MySQL) collect() (map[string]int64, error) {
if m.db == nil {
if err := m.openConnection(); err != nil {
return nil, err
}
Method Windows.collectNet
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (w *Windows) collectNet(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "net_nic_"
for _, pm := range pms.FindByName(metricNetBytesReceivedTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
Function matchChunk
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func matchChunk(chunk, s string) (rest string, ok bool, err error) {
for len(chunk) > 0 {
if len(s) == 0 {
return
}
Function applySmallSegmentGrouping
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
applySmallSegmentGrouping: function(data, smallSegmentGrouping) {
var totalSize;
if (smallSegmentGrouping.valueType === "percentage") {
totalSize = math.getTotalPieSize(data);
}
Function netdataHighlightCallback
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
netdataHighlightCallback: function (status, after, before) {
//console.log(2);
//console.log(new Error().stack);
if (status === true && (after === null || before === null || after <= 0 || before <= 0 || after >= before)) {
Function initialCheck
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialCheck: function(pie) {
var cssPrefix = pie.cssPrefix;
var element = pie.element;
var options = pie.options;
Function collectSystemWorkload
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func collectSystemWorkload(sm *systemMetrics, ss client.SystemStatistics) {
m := &sm.Workload
m.Total.BW.set(
calcBW(ss.TotalReadBwc),