firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Function loadRequiredJs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

NETDATA.loadRequiredJs = function (index, callback) {
    if (index >= NETDATA.requiredJs.length) {
        if (typeof callback === 'function') {
            return callback();
        }
Severity: Minor
Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

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

      Function chartRefresherNoParallel has 41 lines of code (exceeds 25 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/v1/dashboard.js - About 1 hr to fix

        Method API.CHART has 13 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            typeID string,
            ID string,
            name string,
            title string,
            units string,
        Severity: Major
        Found in src/go/pkg/netdataapi/api.go - About 1 hr to fix

          Function __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, stream,
          Severity: Major
          Found in src/collectors/python.d.plugin/python_modules/pyyaml3/dumper.py - About 1 hr to fix

            Function __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, stream,
            Severity: Major
            Found in src/collectors/python.d.plugin/python_modules/pyyaml3/cyaml.py - About 1 hr to fix

              Function __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, stream,
              Severity: Major
              Found in src/collectors/python.d.plugin/python_modules/pyyaml3/cyaml.py - About 1 hr to fix

                Function __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, stream,
                Severity: Major
                Found in src/collectors/python.d.plugin/python_modules/pyyaml3/cyaml.py - About 1 hr to fix

                  Function __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, stream,
                  Severity: Major
                  Found in src/collectors/python.d.plugin/python_modules/pyyaml3/dumper.py - About 1 hr to fix

                    Function __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, stream,
                    Severity: Major
                    Found in src/collectors/python.d.plugin/python_modules/pyyaml3/dumper.py - About 1 hr to fix

                      Function serialize_all has 13 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def serialize_all(nodes, stream=None, Dumper=Dumper,
                      Severity: Major
                      Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 1 hr to fix

                        Function urlopen has 13 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def urlopen(self, method, url, body=None, headers=None, retries=None,

                          Function getSnapshotData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              this.getSnapshotData = function (key) {
                                  if (this.debug) {
                                      this.log('updating from snapshot: ' + key);
                                  }
                          
                          
                          Severity: Minor
                          Found in src/web/gui/src/dashboard.js/main.js - About 1 hr to fix

                            Function getSnapshotData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                this.getSnapshotData = function (key) {
                                    if (this.debug) {
                                        this.log('updating from snapshot: ' + key);
                                    }
                            
                            
                            Severity: Minor
                            Found in src/web/gui/v1/dashboard.js - About 1 hr to fix

                              Function update_chart has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          function update_chart(idx) {
                                              if (saveSnapshotStop === true) {
                                                  saveSnapshotModalLog('info', 'Cancelled!');
                                                  saveSnapshotRestore();
                                                  return;
                              Severity: Minor
                              Found in src/web/gui/main.js - About 1 hr to fix

                                Function checkConflict has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    checkConflict: function(pie, currIndex, direction, size) {
                                    var i, curr;
                                
                                        if (size <= 1) {
                                            return;
                                Severity: Minor
                                Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                                  Function computePieRadius has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      computePieRadius: function(pie) {
                                          var size = pie.options.size;
                                          var canvasPadding = pie.options.misc.canvasPadding;
                                  
                                          // outer radius is either specified (e.g. through the generator), or omitted altogether
                                  Severity: Minor
                                  Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                                    Function loadSnapshotPreflightFile has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function loadSnapshotPreflightFile(file) {
                                        var filename = NETDATA.xss.string(file.name);
                                        var fr = new FileReader();
                                        fr.onload = function (e) {
                                            document.getElementById('loadSnapshotFilename').innerHTML = filename;
                                    Severity: Minor
                                    Found in src/web/gui/main.js - About 1 hr to fix

                                      Method Postgres.doQueryQueryableDatabases has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      func (p *Postgres) doQueryQueryableDatabases() error {
                                          q := queryQueryableDatabaseList()
                                      
                                          var dbs []string
                                          err := p.doQuery(q, func(_, value string, _ bool) {
                                      Severity: Minor
                                      Found in src/go/plugin/go.d/modules/postgres/do_query_misc.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 SquidLog.createCharts has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      func (s *SquidLog) createCharts(line *logLine) error {
                                          if line.empty() {
                                              return errors.New("empty line")
                                          }
                                          charts := &Charts{
                                      Severity: Minor
                                      Found in src/go/plugin/go.d/modules/squidlog/charts.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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language