firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Manager has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

func (m *Manager) dyncfgModuleCreate(name string) {
    id := dyncfgModID(name)
    path := dyncfgPath
    cmds := dyncfgModCmds()
    typ := "template"
Severity: Minor
Found in src/go/plugin/go.d/agent/jobmgr/dyncfg.go - About 2 hrs to fix

    HTTPHeaderDict has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class HTTPHeaderDict(MutableMapping):
        """
        :param headers:
            An iterable of field-value pairs. Must not contain multiple field names
            when compared case-insensitively.
    Severity: Minor
    Found in src/collectors/python.d.plugin/python_modules/urllib3/_collections.py - About 2 hrs to fix

      Method Cassandra.processMetric has 79 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (c *Cassandra) processMetric(mx map[string]int64) {
          c.mx.clientReqTotalLatencyReads.write(mx, "client_request_total_latency_reads")
          c.mx.clientReqTotalLatencyWrites.write(mx, "client_request_total_latency_writes")
          c.mx.clientReqLatencyReads.write(mx, "client_request_latency_reads")
          c.mx.clientReqLatencyWrites.write(mx, "client_request_latency_writes")
      Severity: Major
      Found in src/go/plugin/go.d/modules/cassandra/collect.go - About 2 hrs to fix

        File registry.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        // Registry of netdata hosts
        
        NETDATA.registry = {
            server: null,         // the netdata registry server
        Severity: Minor
        Found in src/web/gui/src/dashboard.js/registry.js - About 2 hrs to fix

          Function parseSsacliControllersInfo has 78 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func parseSsacliControllersInfo(data []byte) (map[string]*hpssaController, error) {
              var (
                  cntrl *hpssaController
                  arr   *hpssaArray
                  ld    *hpssaLogicalDrive
          Severity: Major
          Found in src/go/plugin/go.d/modules/hpssa/parse.go - About 2 hrs to fix

            Function access has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                access: function (max_redirects, callback) {
                    let name = NETDATA.registry.MASKED_DATA;
                    let url = NETDATA.registry.MASKED_DATA;
            
                    if (!NETDATA.registry.isUsingGlobalRegistry()) {
            Severity: Major
            Found in src/web/gui/src/dashboard.js/registry.js - About 2 hrs to fix

              Method SystemdUnits.collectUnits has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
              Open

              func (s *SystemdUnits) collectUnits(mx map[string]int64, conn systemdConnection) error {
                  var units []dbus.UnitStatus
                  var err error
              
                  if s.systemdVersion >= 230 {
              Severity: Minor
              Found in src/go/plugin/go.d/modules/systemdunits/collect_units.go - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method Windows.collectProcess has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
              Open

              func (w *Windows) collectProcess(mx map[string]int64, pms prometheus.Series) {
                  if !w.cache.collection[collectorProcess] {
                      w.cache.collection[collectorProcess] = true
                      w.addProcessesCharts()
                  }
              Severity: Minor
              Found in src/go/plugin/go.d/modules/windows/collect_process.go - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function morrisInitialize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              NETDATA.morrisInitialize = function(callback) {
                  if (typeof netdataNoMorris === 'undefined' || !netdataNoMorris) {
              
                      // morris requires raphael
                      if (!NETDATA.chartLibraries.raphael.initialized) {
              Severity: Minor
              Found in src/web/gui/src/dashboard.js/charting/_morris.js - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function c3Initialize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              NETDATA.c3Initialize = function(callback) {
                  if (typeof netdataNoC3 === 'undefined' || !netdataNoC3) {
              
                      // C3 requires D3
                      if (!NETDATA.chartLibraries.d3.initialized) {
              Severity: Minor
              Found in src/web/gui/src/dashboard.js/charting/_c3.js - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function d3pieInitialize has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function expect_node has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def expect_node(self, root=False, sequence=False, mapping=False,
                          simple_key=False):
                      self.root_context = root
                      self.sequence_context = sequence
                      self.mapping_context = mapping
              Severity: Minor
              Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function select has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                      def select(self, timeout=None):
                          # Selecting on empty lists on Windows errors out.
                          if not len(self._readers) and not len(self._writers):
                              return []
              
              

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function parseStatusLine has 77 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func parseStatusLine(line string, lineFormat []string) (*metric, error) {
                  parts := strings.Split(line, ",")
              
                  // NOTE: only default line format is supported
                  // TODO: custom line format?
              Severity: Major
              Found in src/go/plugin/go.d/modules/tengine/status.go - About 2 hrs to fix

                Method nvidiaSmiLoopExec.run has 76 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (e *nvidiaSmiLoopExec) run() error {
                    secs := 5
                    if e.updateEvery < secs {
                        secs = e.updateEvery
                    }
                Severity: Major
                Found in src/go/plugin/go.d/modules/nvidia_smi/exec.go - About 2 hrs to fix

                  Method Envoy.collectClusterUpstreamStats has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (e *Envoy) collectClusterUpstreamStats(mx map[string]int64, mfs prometheus.MetricFamilies) {
                      seen := make(map[string]bool)
                      for _, n := range []string{
                          "envoy_cluster_upstream_cx_total",
                          "envoy_cluster_upstream_cx_http1_total",
                  Severity: Minor
                  Found in src/go/plugin/go.d/modules/envoy/collect.go - About 2 hrs to fix

                    Function computeLinePosition has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        computeLinePosition: function(pie, i) {
                            var angle = segments.getSegmentAngle(i, pie.options.data.content, pie.totalSize, { midpoint: true });
                            var originCoords = math.rotate(pie.pieCenter.x, pie.pieCenter.y - pie.outerRadius, pie.pieCenter.x, pie.pieCenter.y, angle);
                            var heightOffset = pie.outerLabelGroupData[i].h / 5; // TODO check
                            var labelXMargin = 6; // the x-distance of the label from the end of the line [TODO configurable]
                    Severity: Minor
                    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 2 hrs to fix

                      Function mousedown has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  mousedown: function (event, dygraph, context) {
                                      if (NETDATA.options.debug.dygraph || state.debug) {
                                          state.log('interactionModel.mousedown()');
                                      }
                      
                      
                      Severity: Minor
                      Found in src/web/gui/src/dashboard.js/charting/dygraph.js - About 1 hr to fix

                        Function access has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            access: function (max_redirects, callback) {
                                let name = NETDATA.registry.hostname;
                                let url = NETDATA.serverDefault;
                        
                                console.log("ACCESS", name, url);
                        Severity: Minor
                        Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

                          Function mousedown has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      mousedown: function (event, dygraph, context) {
                                          if (NETDATA.options.debug.dygraph || state.debug) {
                                              state.log('interactionModel.mousedown()');
                                          }
                          
                          
                          Severity: Minor
                          Found in src/web/gui/v1/dashboard.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language