firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Function dygraphChartUpdate has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

NETDATA.dygraphChartUpdate = function (state, data) {
    let dygraph = state.tmp.dygraph_instance;

    if (typeof dygraph === 'undefined') {
        return NETDATA.dygraphChartCreate(state, data);
Severity: Major
Found in src/web/gui/v1/dashboard.js - About 3 hrs to fix

    Function _init has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var _init = function() {
    
            // prep-work
            this.svg = helpers.addSVGSpace(this);
    
    
    Severity: Major
    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 3 hrs to fix

      Function queryReplicationSlotFiles has 104 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func queryReplicationSlotFiles(version int) string {
          if version < pgVersion11 {
              return `
      WITH wal_size AS (
        SELECT
      Severity: Major
      Found in src/go/plugin/go.d/modules/postgres/queries.go - About 3 hrs to fix

        Method Windows.collectIIS has 104 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (w *Windows) collectIIS(mx map[string]int64, pms prometheus.Series) {
            seen := make(map[string]bool)
            px := "iis_website_"
            for _, pm := range pms.FindByName(metricIISCurrentAnonymousUsers) {
                if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
        Severity: Major
        Found in src/go/plugin/go.d/modules/windows/collect_iis.go - About 3 hrs to fix

          Function googleChartCreate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          NETDATA.googleChartCreate = function (state, data) {
              let datatable = new google.visualization.DataTable(data.result);
          
              state.google_options = {
                  colors: state.chartColors(),
          Severity: Major
          Found in src/web/gui/src/dashboard.js/charting/google-charts.js - About 3 hrs to fix

            Function googleChartCreate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            NETDATA.googleChartCreate = function (state, data) {
                let datatable = new google.visualization.DataTable(data.result);
            
                state.google_options = {
                    colors: state.chartColors(),
            Severity: Major
            Found in src/web/gui/v1/dashboard.js - About 3 hrs to fix

              File charts.go has 546 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // SPDX-License-Identifier: GPL-3.0-or-later
              
              package ceph
              
              import (
              Severity: Minor
              Found in src/go/plugin/go.d/modules/ceph/charts.go - About 3 hrs to fix

                Method Docker.collectContainers has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
                Open

                func (d *Docker) collectContainers(mx map[string]int64) error {
                    containerSet := make(map[string][]types.Container)
                
                    for _, status := range containerHealthStatuses {
                        if err := func() error {
                Severity: Minor
                Found in src/go/plugin/go.d/modules/docker/collect.go - About 3 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 handler has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    handler: function (entries, observer) {
                        entries.forEach(function (entry) {
                            let state = NETDATA.chartState(entry.target);
                
                            let idx;
                Severity: Minor
                Found in src/web/gui/src/dashboard.js/main.js - About 3 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 setHandler has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                dimensionStatus.prototype.setHandler = function () {
                    if (!this.enabled) {
                        return;
                    }
                
                
                Severity: Minor
                Found in src/web/gui/src/dashboard.js/main.js - About 3 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 notify has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    notify: function (entry) {
                        // console.log('alarm ' + entry.unique_id);
                
                        if (entry.updated) {
                            // console.log('alarm ' + entry.unique_id + ' has been updated by another alarm');
                Severity: Minor
                Found in src/web/gui/src/dashboard.js/alarms.js - About 3 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_spaces has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    def scan_plain_spaces(self, indent, start_mark):
                        # See the specification for details.
                        # The specification is really confusing about tabs in plain scalars.
                        # We just forbid them completely. Do not use tabs in YAML!
                        chunks = []
                Severity: Minor
                Found in src/collectors/python.d.plugin/python_modules/pyyaml3/scanner.py - About 3 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_document_start has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    def expect_document_start(self, first=False):
                        if isinstance(self.event, DocumentStartEvent):
                            if (self.event.version or self.event.tags) and self.open_ended:
                                self.write_indicator('...', True)
                                self.write_indent()
                Severity: Minor
                Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 3 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 has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    def scan_block_scalar(self, style):
                        # See the specification for details.
                
                        if style == '>':
                            folded = True
                Severity: Minor
                Found in src/collectors/python.d.plugin/python_modules/pyyaml3/scanner.py - About 3 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 add_path_resolver has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    def add_path_resolver(cls, tag, path, kind=None):
                        # Note: `add_path_resolver` is experimental.  The API could be changed.
                        # `new_path` is a pattern that is matched against the path from the
                        # root to the node that is being considered.  `node_path` elements are
                        # tuples `(node_check, index_check)`.  `node_check` is a node class:
                Severity: Minor
                Found in src/collectors/python.d.plugin/python_modules/pyyaml3/resolver.py - About 3 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 parse_url has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                def parse_url(url):
                    """
                    Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
                    performed to parse incomplete urls. Fields not provided will be None.
                
                
                Severity: Minor
                Found in src/collectors/python.d.plugin/python_modules/urllib3/util/url.py - About 3 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 renderMyNetdataMenu has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function renderMyNetdataMenu(machinesArray) {
                    const el = document.getElementById('my-netdata-dropdown-content');
                    el.classList.add(`theme-${netdataTheme}`);
                
                    if (machinesArray == registryAgents) {
                Severity: Major
                Found in src/web/gui/main.js - About 3 hrs to fix

                  File d3pie.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  
                  // d3pie
                  
                  NETDATA.d3pieInitialize = function (callback) {
                      if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
                  Severity: Minor
                  Found in src/web/gui/src/dashboard.js/charting/d3pie.js - About 3 hrs to fix

                    Function add has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        add: function(pie, section, sectionDisplayType) {
                            var include = labels.getIncludes(sectionDisplayType);
                            var settings = pie.options.labels;
                    
                            // group the label groups (label, percentage, value) into a single element for simpler positioning
                    Severity: Major
                    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 3 hrs to fix

                      HTTPResponse has 26 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class HTTPResponse(io.IOBase):
                          """
                          HTTP Response container.
                      
                          Backwards-compatible to httplib's HTTPResponse but the response ``body`` is
                      Severity: Minor
                      Found in src/collectors/python.d.plugin/python_modules/urllib3/response.py - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language