firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

File job.go has 541 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// SPDX-License-Identifier: GPL-3.0-or-later

package module

import (
Severity: Minor
Found in src/go/plugin/go.d/agent/module/job.go - About 3 hrs to fix

    File retry.py has 291 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # SPDX-License-Identifier: MIT
    from __future__ import absolute_import
    import time
    import logging
    from collections import namedtuple
    Severity: Minor
    Found in src/collectors/python.d.plugin/python_modules/urllib3/util/retry.py - About 3 hrs to fix

      Function alarm_to_html has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function alarm_to_html(alarm, full) {
                  var chart = options.data.charts[alarm.chart];
                  if (typeof (chart) === 'undefined') {
                      chart = options.data.charts_by_name[alarm.chart];
                      if (typeof (chart) === 'undefined') {
      Severity: Major
      Found in src/web/gui/main.js - About 2 hrs to fix

        Function seconds4human has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        NETDATA.seconds4human = function (seconds, options) {
            let defaultOptions = {
                now: 'now',
                space: ' ',
                negative_suffix: 'ago',
        Severity: Minor
        Found in src/web/gui/src/dashboard.js/utils.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 gaugeChartCreate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        NETDATA.gaugeChartCreate = function (state, data) {
            // let chart = $(state.element_chart);
        
            let value = data.result[0];
            let min = NETDATA.dataAttribute(state.element, 'gauge-min-value', null);
        Severity: Minor
        Found in src/web/gui/src/dashboard.js/charting/gauge.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 renderStreamedHosts has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        function renderStreamedHosts(options) {
            let html = `<div class="info-item">Databases streamed to this agent</div>`;
        
            var base = document.location.origin.toString() +
              document.location.pathname.toString()
        Severity: Minor
        Found in src/web/gui/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 fetch_more_tokens has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def fetch_more_tokens(self):
        
                # Eat whitespaces and comments until we reach the next token.
                self.scan_to_next_token()
        
        
        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 scan_plain has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def scan_plain(self):
                # See the specification for details.
                # We add an additional restriction for the flow context:
                #   plain scalars in the flow context cannot contain ',', ':' and '?'.
                # We also keep track of the `allow_simple_key` flag here.
        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 prepare_tag has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def prepare_tag(self, tag):
                if not tag:
                    raise EmitterError("tag must not be empty")
                if tag == '!':
                    return tag
        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

        File alarms.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        // Registry of netdata hosts
        
        NETDATA.alarms = {
            onclick: null,                  // the callback to handle the click - it will be called with the alarm log entry
        Severity: Minor
        Found in src/web/gui/src/dashboard.js/alarms.js - About 2 hrs to fix

          File SocketService.py has 287 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          # Description:
          # Author: Pawel Krupa (paulfantom)
          # Author: Ilya Mashchenko (ilyam8)
          # SPDX-License-Identifier: GPL-3.0-or-later

            Function wheel has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        wheel: function (event, dygraph, context) {
                            void(context);
            
                            if (NETDATA.options.debug.dygraph || state.debug) {
                                state.log('interactionModel.wheel()');
            Severity: Major
            Found in src/web/gui/src/dashboard.js/charting/dygraph.js - About 2 hrs to fix

              Function wheel has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          wheel: function (event, dygraph, context) {
                              void(context);
              
                              if (NETDATA.options.debug.dygraph || state.debug) {
                                  state.log('interactionModel.wheel()');
              Severity: Major
              Found in src/web/gui/v1/dashboard.js - About 2 hrs to fix

                OrderedDict has 25 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class OrderedDict(dict):
                    'Dictionary that remembers insertion order'
                    # An inherited dict maps keys to values.
                    # The inherited dict provides __getitem__, __len__, __contains__, and get.
                    # The remaining methods are order-aware.

                  File filelock.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # This is free and unencumbered software released into the public domain.
                  #
                  # Anyone is free to copy, modify, publish, use, compile, sell, or
                  # distribute this software, either in source code form or as a compiled
                  # binary, for any purpose, commercial or non-commercial, and by any
                  Severity: Minor
                  Found in src/collectors/python.d.plugin/python_modules/third_party/filelock.py - About 2 hrs to fix

                    Function addSegmentEventHandlers has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        addSegmentEventHandlers: function(pie) {
                            var arc = pie.svg.selectAll("." + pie.cssPrefix + "arc");
                            arc = arc.merge(pie.__labels.inner.merge(pie.__labels.outer));
                    
                            arc.on("click", function() {
                    Severity: Major
                    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 2 hrs to fix

                      Function parseZpoolListVdevOutput has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func parseZpoolListVdevOutput(bs []byte) ([]vdevEntry, error) {
                          var headers []string
                          var vdevs []vdevEntry
                          sc := bufio.NewScanner(bytes.NewReader(bs))
                      
                      
                      Severity: Minor
                      Found in src/go/plugin/go.d/modules/zfspool/collect_zpool_list_vdev.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 selected_server_timezone has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var selected_server_timezone = function (timezone, status) {
                          //console.log('called with timezone: ' + timezone + ", status: " + ((typeof status === 'undefined')?'undefined':status).toString());
                      
                          // clear the error
                          document.getElementById('timezone_error_message').innerHTML = '';
                      Severity: Minor
                      Found in src/web/gui/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 process_tag has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def process_tag(self):
                              tag = self.event.tag
                              if isinstance(self.event, ScalarEvent):
                                  if self.style is None:
                                      self.style = self.choose_scalar_style()
                      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 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/src/dashboard.js/utils.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language