firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Method Job.createChart has 63 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (j *Job) createChart(chart *Chart) {
    defer func() { chart.created = true }()
    if chart.ignore {
        return
    }
Severity: Minor
Found in src/go/plugin/go.d/agent/module/job.go - About 1 hr to fix

    Method Cassandra.collectClientRequestMetrics has 63 lines of code (exceeds 50 allowed). Consider refactoring.
    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) {
    Severity: Minor
    Found in src/go/plugin/go.d/modules/cassandra/collect.go - About 1 hr to fix

      Method Smartctl.collectSmartDevice has 63 lines of code (exceeds 50 allowed). Consider refactoring.
      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
      Severity: Minor
      Found in src/go/plugin/go.d/modules/smartctl/collect.go - About 1 hr to fix

        Function d3pieInitialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        NETDATA.d3pieInitialize = function (callback) {
            if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
        
                // d3pie requires D3
                if (!NETDATA.chartLibraries.d3.initialized) {
        Severity: Minor
        Found in src/web/gui/src/dashboard.js/charting/d3pie.js - About 1 hr to fix

          Function getLocaleString has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getLocaleString: function (min, max) {
                  let key = max;
                  if (min === max) {
                      if (typeof this.formattersFixed[key] === 'undefined') {
                          this.formattersFixed[key] = {
          Severity: Minor
          Found in src/web/gui/src/dashboard.js/utils.js - About 1 hr to fix

            Function getLocaleString has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getLocaleString: function (min, max) {
                    let key = max;
                    if (min === max) {
                        if (typeof this.formattersFixed[key] === 'undefined') {
                            this.formattersFixed[key] = {
            Severity: Minor
            Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

              Function d3pieInitialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              NETDATA.d3pieInitialize = function (callback) {
                  if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
              
                      // d3pie requires D3
                      if (!NETDATA.chartLibraries.d3.initialized) {
              Severity: Minor
              Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

                Method logLine.verify has 16 return statements (exceeds 4 allowed).
                Open

                func (l *logLine) verify() error {
                    if l.empty() {
                        return fmt.Errorf("verify: %w", errEmptyLine)
                    }
                    if l.hasRespCode() && !l.isRespCodeValid() {
                Severity: Major
                Found in src/go/plugin/go.d/modules/weblog/logline.go - About 1 hr to fix

                  Method WebLog.createCharts has 16 return statements (exceeds 4 allowed).
                  Open

                  func (w *WebLog) createCharts(line *logLine) error {
                      if line.empty() {
                          return errors.New("empty line")
                      }
                      w.charts = nil
                  Severity: Major
                  Found in src/go/plugin/go.d/modules/weblog/charts.go - About 1 hr to fix

                    Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, total=10, connect=None, read=None, redirect=None, status=None,
                    Severity: Major
                    Found in src/collectors/python.d.plugin/python_modules/urllib3/util/retry.py - About 1 hr to fix

                      Method Prometheus.addHistogramCharts has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (p *Prometheus) addHistogramCharts(id, name, help string, labels labels.Labels, buckets []prometheus.Bucket) {
                          units := getChartUnits(name)
                      
                          switch units {
                          case "seconds", "time":
                      Severity: Minor
                      Found in src/go/plugin/go.d/modules/prometheus/charts.go - About 1 hr to fix

                        Method Prometheus.addSummaryCharts has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (p *Prometheus) addSummaryCharts(id, name, help string, labels labels.Labels, quantiles []prometheus.Quantile) {
                            units := getChartUnits(name)
                        
                            switch units {
                            case "seconds", "time":
                        Severity: Minor
                        Found in src/go/plugin/go.d/modules/prometheus/charts.go - About 1 hr to fix

                          Method NginxPlus.queryAvailableEndpoints has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                          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 {
                          Severity: Minor
                          Found in src/go/plugin/go.d/modules/nginxplus/nginx_http_api_query.go - About 1 hr to fix

                            Method MySQL.collect has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

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

                              Method Windows.collectNet has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                              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 != "" {
                              Severity: Minor
                              Found in src/go/plugin/go.d/modules/windows/collect_net.go - About 1 hr to fix

                                Function matchChunk has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func matchChunk(chunk, s string) (rest string, ok bool, err error) {
                                    for len(chunk) > 0 {
                                        if len(s) == 0 {
                                            return
                                        }
                                Severity: Minor
                                Found in src/go/pkg/matcher/glob.go - About 1 hr to fix

                                  Function applySmallSegmentGrouping has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      applySmallSegmentGrouping: function(data, smallSegmentGrouping) {
                                          var totalSize;
                                          if (smallSegmentGrouping.valueType === "percentage") {
                                              totalSize = math.getTotalPieSize(data);
                                          }
                                  Severity: Minor
                                  Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                                    Function netdataHighlightCallback has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    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)) {
                                    Severity: Minor
                                    Found in src/web/gui/main.js - About 1 hr to fix

                                      Function initialCheck has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          initialCheck: function(pie) {
                                              var cssPrefix = pie.cssPrefix;
                                              var element = pie.element;
                                              var options = pie.options;
                                      
                                      
                                      Severity: Minor
                                      Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                                        Function collectSystemWorkload has 61 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

                                        func collectSystemWorkload(sm *systemMetrics, ss client.SystemStatistics) {
                                            m := &sm.Workload
                                        
                                            m.Total.BW.set(
                                                calcBW(ss.TotalReadBwc),
                                        Severity: Minor
                                        Found in src/go/plugin/go.d/modules/scaleio/collect_system.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language