firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Function seconds4human has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

NETDATA.seconds4human = function (seconds, options) {
    let defaultOptions = {
        now: 'now',
        space: ' ',
        negative_suffix: 'ago',
Severity: Major
Found in src/web/gui/v1/dashboard.js - About 2 hrs to fix

    Function loadSnapshot has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function loadSnapshot() {
        $('#loadSnapshotImport').addClass('disabled');
    
        if (tmpSnapshotData === null) {
            loadSnapshotPreflightEmpty();
    Severity: Major
    Found in src/web/gui/main.js - About 2 hrs to fix

      File __init__.py has 278 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # SPDX-License-Identifier: MIT
      
      from .error import *
      
      from .tokens import *
      Severity: Minor
      Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 2 hrs to fix

        Config has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type Config map[string]any
        Severity: Minor
        Found in src/go/plugin/go.d/agent/confgroup/config.go - About 2 hrs to fix

          Function init has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              init: function (timezone) {
                  //console.log('init with timezone: ' + timezone);
          
                  // detect browser timezone
                  try {
          Severity: Major
          Found in src/web/gui/src/dashboard.js/main.js - About 2 hrs to fix

            Function init has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                init: function (timezone) {
                    //console.log('init with timezone: ' + timezone);
            
                    // detect browser timezone
                    try {
            Severity: Major
            Found in src/web/gui/v1/dashboard.js - About 2 hrs to fix

              File representer.py has 276 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # SPDX-License-Identifier: MIT
              
              __all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
                  'RepresenterError']
              
              
              Severity: Minor
              Found in src/collectors/python.d.plugin/python_modules/pyyaml3/representer.py - About 2 hrs to fix

                Method NvidiaSmi.collectGPUInfo has 90 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (nv *NvidiaSmi) collectGPUInfo(mx map[string]int64) error {
                    bs, err := nv.exec.queryGPUInfo()
                    if err != nil {
                        return fmt.Errorf("error on quering XML GPU info: %v", err)
                    }
                Severity: Major
                Found in src/go/plugin/go.d/modules/nvidia_smi/collect.go - About 2 hrs to fix

                  Method VerneMQ.getNodesStats has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (v *VerneMQ) getNodesStats(mfs prometheus.MetricFamilies) map[string]*nodeStats {
                      nodes := make(map[string]*nodeStats)
                  
                      for _, mf := range mfs {
                          name, _ := strings.CutPrefix(mf.Name(), v.namespace.name+"_")
                  Severity: Minor
                  Found in src/go/plugin/go.d/modules/vernemq/collect.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 easypiechartPercentFromValueMinMax has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  NETDATA.easypiechartPercentFromValueMinMax = function (state, value, min, max) {
                      if (typeof value !== 'number') {
                          value = 0;
                      }
                      if (typeof min !== 'number') {
                  Severity: Minor
                  Found in src/web/gui/src/dashboard.js/charting/easy-pie-chart.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 chartRefresherNoParallel has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  NETDATA.chartRefresherNoParallel = function (index, callback) {
                      let targets = NETDATA.intersectionObserver.targets();
                  
                      if (NETDATA.options.debug.main_loop) {
                          console.log('NETDATA.chartRefresherNoParallel(' + index + ')');
                  Severity: Minor
                  Found in src/web/gui/src/dashboard.js/main.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 _get_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _get_data(self):
                          if not self.is_alive():
                              return None
                  
                          data = {}
                  Severity: Minor
                  Found in src/collectors/python.d.plugin/spigotmc/spigotmc.chart.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 descend_resolver has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def descend_resolver(self, current_node, current_index):
                          if not self.yaml_path_resolvers:
                              return
                          exact_paths = {}
                          prefix_paths = []
                  Severity: Minor
                  Found in src/collectors/python.d.plugin/python_modules/pyyaml3/resolver.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 scan_block_scalar_indicators has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def scan_block_scalar_indicators(self, start_mark):
                          # See the specification for details.
                          chomping = None
                          increment = None
                          ch = self.peek()
                  Severity: Minor
                  Found in src/collectors/python.d.plugin/python_modules/pyyaml3/scanner.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 create has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create(self):
                          for chart_name in self.order:
                              chart_config = self.definitions.get(chart_name)
                  
                              if not chart_config:

                  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 _write_callback has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _write_callback(connection_id, data_buffer, data_length_pointer):
                      """
                      SecureTransport write callback. This is called by ST to request that data
                      actually be sent on the network.
                      """

                  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 cleanup has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def cleanup():
                      """
                      clean directories that are either data collection or exporting integrations
                      """
                      for element in Path("src/go/plugin/go.d/modules").glob('**/*/'):
                  Severity: Minor
                  Found in integrations/gen_docs_integrations.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 chartURL has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.chartURL = function () {
                          let after, before, points_multiplier = 1;
                          if (NETDATA.globalPanAndZoom.isActive()) {
                              if (this.current.force_before_ms !== null && this.current.force_after_ms !== null) {
                                  this.tm.pan_and_zoom_seq = 0;
                  Severity: Major
                  Found in src/web/gui/src/dashboard.js/main.js - About 2 hrs to fix

                    Function chartURL has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.chartURL = function () {
                            let after, before, points_multiplier = 1;
                            if (NETDATA.globalPanAndZoom.isActive()) {
                                if (this.current.force_before_ms !== null && this.current.force_after_ms !== null) {
                                    this.tm.pan_and_zoom_seq = 0;
                    Severity: Major
                    Found in src/web/gui/v1/dashboard.js - About 2 hrs to fix

                      Function renderChartsAndMenu has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function renderChartsAndMenu(data) {
                          options.menus = {};
                          options.submenu_names = {};
                      
                          var menus = options.menus;
                      Severity: Major
                      Found in src/web/gui/main.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language