firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Method Rethinkdb.collectStats has 61 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (r *Rethinkdb) collectStats(mx map[string]int64) error {
    resp, err := r.rdb.stats()
    if err != nil {
        return err
    }
Severity: Minor
Found in src/go/plugin/go.d/modules/rethinkdb/collect.go - About 1 hr to fix

    Function gaugeSetSelection has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    NETDATA.gaugeSetSelection = function (state, t) {
        if (state.timeIsVisible(t) !== true) {
            return NETDATA.gaugeClearSelection(state, true);
        }
    
    
    Severity: Minor
    Found in src/web/gui/src/dashboard.js/charting/gauge.js - About 1 hr to fix

      Function c3Initialize has 36 lines of code (exceeds 25 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 1 hr to fix

        Function object has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            object: function (name, obj, ignore_regex) {
                if (typeof ignore_regex !== 'undefined' && ignore_regex.test(name)) {
                    // console.log('XSS: ignoring "' + name + '"');
                    return obj;
                }
        Severity: Minor
        Found in src/web/gui/src/dashboard.js/xss.js - About 1 hr to fix

          Function morrisInitialize has 36 lines of code (exceeds 25 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 1 hr to fix

            Function unhideChart has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.unhideChart = function () {
                    if (!isHidden()) {
                        return;
                    }
            
            
            Severity: Minor
            Found in src/web/gui/src/dashboard.js/main.js - About 1 hr to fix

              Function gaugeSetSelection has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              NETDATA.gaugeSetSelection = function (state, t) {
                  if (state.timeIsVisible(t) !== true) {
                      return NETDATA.gaugeClearSelection(state, true);
                  }
              
              
              Severity: Minor
              Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

                Function unhideChart has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    this.unhideChart = function () {
                        if (!isHidden()) {
                            return;
                        }
                
                
                Severity: Minor
                Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

                  Function object has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      object: function (name, obj, ignore_regex) {
                          if (typeof ignore_regex !== 'undefined' && ignore_regex.test(name)) {
                              // console.log('XSS: ignoring "' + name + '"');
                              return obj;
                          }
                  Severity: Minor
                  Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

                    Function downloadAll has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      downloadAll: function (host, callback) {
                        host = fixHost(host);
                    
                        let self = this;
                    
                    
                    Severity: Minor
                    Found in src/web/gui/v1/dashboard-react.js - About 1 hr to fix

                      Function object has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        object: function (name, obj, ignore_regex) {
                          if (typeof ignore_regex !== 'undefined' && ignore_regex.test(name)) {
                            // console.log('XSS: ignoring "' + name + '"');
                            return obj;
                          }
                      Severity: Minor
                      Found in src/web/gui/v1/dashboard-react.js - About 1 hr to fix

                        Function parseSsacliControllersInfo has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func parseSsacliControllersInfo(data []byte) (map[string]*hpssaController, error) {
                            var (
                                cntrl *hpssaController
                                arr   *hpssaArray
                                ld    *hpssaLogicalDrive
                        Severity: Minor
                        Found in src/go/plugin/go.d/modules/hpssa/parse.go - About 1 hr 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.collectAD has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func (w *Windows) collectAD(mx map[string]int64, pms prometheus.Series) {
                            if !w.cache.collection[collectorAD] {
                                w.cache.collection[collectorAD] = true
                                w.addADCharts()
                            }
                        Severity: Minor
                        Found in src/go/plugin/go.d/modules/windows/collect_ad.go - About 1 hr 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 MySQL.collect has a Cognitive Complexity of 27 (exceeds 20 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

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

                            parsePersonUrls: function (person_urls) {
                                NETDATA.registry.person_urls = person_urls;
                        
                                if (person_urls) {
                                    NETDATA.registry.machines = {};
                        Severity: Minor
                        Found in src/web/gui/src/dashboard.js/registry.js - About 1 hr 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 dataAttribute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        NETDATA.dataAttribute = function (element, attribute, def) {
                            let key = 'data-' + attribute.toString();
                            if (element.hasAttribute(key)) {
                                let data = element.getAttribute(key);
                        
                        
                        Severity: Minor
                        Found in src/web/gui/src/dashboard.js/utils.js - About 1 hr 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 serialize_node has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def serialize_node(self, node, parent, index):
                                alias = self.anchors[node]
                                if node in self.serialized_nodes:
                                    self.emit(AliasEvent(alias))
                                else:
                        Severity: Minor
                        Found in src/collectors/python.d.plugin/python_modules/pyyaml3/serializer.py - About 1 hr 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 _new_conn has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _new_conn(self):
                                """
                                Establish a new connection via the SOCKS proxy.
                                """
                                extra_kw = {}

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

                            def recv_into(self, *args, **kwargs):
                                try:
                                    return self.connection.recv_into(*args, **kwargs)
                                except OpenSSL.SSL.SysCallError as e:
                                    if self.suppress_ragged_eofs and e.args == (-1, 'Unexpected EOF'):

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

                        def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
                                            ca_certs=None, server_hostname=None,
                                            ssl_version=None, ciphers=None, ssl_context=None,
                                            ca_cert_dir=None):
                            """
                        Severity: Minor
                        Found in src/collectors/python.d.plugin/python_modules/urllib3/util/ssl_.py - About 1 hr 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

                        Severity
                        Category
                        Status
                        Source
                        Language