netdata/netdata

View on GitHub

Showing 1,242 of 2,966 total issues

File dashboard.js has 7658 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

// DO NOT EDIT: This file is automatically generated from the source files in src/

// ----------------------------------------------------------------------------
Severity: Major
Found in src/web/gui/v1/dashboard.js - About 3 wks to fix

    File dashboard_info.js has 7041 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // SPDX-License-Identifier: GPL-3.0-or-later
    
    // Codacy declarations
    /* global NETDATA */
    
    
    Severity: Major
    Found in src/web/gui/dashboard_info.js - About 2 wks to fix

      Function chartState has a Cognitive Complexity of 904 (exceeds 5 allowed). Consider refactoring.
      Open

      let chartState = function (element) {
          this.element = element;
      
          // IMPORTANT:
          // all private functions should use 'that', instead of 'this'
      Severity: Minor
      Found in src/web/gui/src/dashboard.js/main.js - About 2 wks 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 charts.go has 4582 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // SPDX-License-Identifier: GPL-3.0-or-later
      
      package windows
      
      import (
      Severity: Major
      Found in src/go/collectors/go.d.plugin/modules/windows/charts.go - About 1 wk to fix

        File main.js has 4102 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Main JavaScript file for the Netdata GUI.
        
        // Codacy declarations
        /* global NETDATA */
        
        
        Severity: Major
        Found in src/web/gui/main.js - About 1 wk to fix

          Function chartState has 2125 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          let chartState = function (element) {
              this.element = element;
          
              // IMPORTANT:
              // all private functions should use 'that', instead of 'this'
          Severity: Major
          Found in src/web/gui/src/dashboard.js/main.js - About 1 wk to fix

            Function chartState has 2125 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            let chartState = function (element) {
                this.element = element;
            
                // IMPORTANT:
                // all private functions should use 'that', instead of 'this'
            Severity: Major
            Found in src/web/gui/v1/dashboard.js - About 1 wk to fix

              File main.js has 3119 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              // *** src/dashboard.js/main.js
              
              // Codacy declarations
              /* global clipboard */
              Severity: Major
              Found in src/web/gui/src/dashboard.js/main.js - About 1 wk to fix

                File dictionary.go has 2224 lines of code (exceeds 500 allowed). Consider refactoring.
                Open

                // SPDX-License-Identifier: GPL-3.0-or-later
                
                package api
                
                import (
                Severity: Major
                Found in src/go/collectors/go.d.plugin/modules/freeradius/api/dictionary.go - About 5 days to fix

                  File d3pie-0.2.1-netdata-3.js has 1606 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*!
                   * d3pie
                   * @author Ben Keen
                   * @version 0.1.9
                   * @date June 17th, 2015
                  Severity: Major
                  Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 4 days to fix

                    Function dygraphChartCreate has a Cognitive Complexity of 205 (exceeds 5 allowed). Consider refactoring.
                    Open

                    NETDATA.dygraphChartCreate = function (state, data) {
                        if (NETDATA.options.debug.dygraph || state.debug) {
                            state.log('dygraphChartCreate()');
                        }
                    
                    
                    Severity: Minor
                    Found in src/web/gui/src/dashboard.js/charting/dygraph.js - About 4 days 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 imageutils.py has 1386 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import os
                    from pathlib import Path
                    
                    import dagger
                    
                    
                    Severity: Major
                    Found in packaging/dag/imageutils.py - About 3 days to fix

                      Function alarmsUpdateModal has 667 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function alarmsUpdateModal() {
                          var active = '<h3>Raised Alarms</h3><table class="table">';
                          var all = '<h3>All Running Alarms</h3><div class="panel-group" id="alarms_all_accordion" role="tablist" aria-multiselectable="true">';
                          var footer = '<hr/><a href="https://github.com/netdata/netdata/tree/master/src/web/api/badges#netdata-badges" target="_blank">netdata badges</a> refresh automatically. Their color indicates the state of the alarm: <span style="color: #e05d44"><b>&nbsp;red&nbsp;</b></span> is critical, <span style="color:#fe7d37"><b>&nbsp;orange&nbsp;</b></span> is warning, <span style="color: #4c1"><b>&nbsp;bright green&nbsp;</b></span> is ok, <span style="color: #9f9f9f"><b>&nbsp;light grey&nbsp;</b></span> is undefined (i.e. no data or no status), <span style="color: #000"><b>&nbsp;black&nbsp;</b></span> is not initialized. You can copy and paste their URLs to embed them in any web page.<br/>netdata can send notifications for these alarms. Check <a href="https://github.com/netdata/netdata/blob/master/src/health/notifications/health_alarm_notify.conf" target="_blank">this configuration file</a> for more information.';
                      
                      
                      Severity: Major
                      Found in src/web/gui/main.js - About 3 days to fix

                        Function dygraphChartCreate has 556 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        NETDATA.dygraphChartCreate = function (state, data) {
                            if (NETDATA.options.debug.dygraph || state.debug) {
                                state.log('dygraphChartCreate()');
                            }
                        
                        
                        Severity: Major
                        Found in src/web/gui/src/dashboard.js/charting/dygraph.js - About 2 days to fix

                          Function dygraphChartCreate has 550 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          NETDATA.dygraphChartCreate = function (state, data) {
                              if (NETDATA.options.debug.dygraph || state.debug) {
                                  state.log('dygraphChartCreate()');
                              }
                          
                          
                          Severity: Major
                          Found in src/web/gui/v1/dashboard.js - About 2 days to fix

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

                            // SPDX-License-Identifier: GPL-3.0-or-later
                            
                            package postgres
                            
                            import (
                            Severity: Major
                            Found in src/go/collectors/go.d.plugin/modules/postgres/charts.go - About 2 days to fix

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

                              // SPDX-License-Identifier: GPL-3.0-or-later
                              
                              package mysql
                              
                              import (
                              Severity: Major
                              Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go - About 2 days to fix

                                File emitter.py has 955 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                # SPDX-License-Identifier: MIT
                                
                                # Emitter expects events obeying the following grammar:
                                # stream ::= STREAM-START document* STREAM-END
                                # document ::= DOCUMENT-START node DOCUMENT-END
                                Severity: Major
                                Found in src/collectors/python.d.plugin/python_modules/pyyaml2/emitter.py - About 2 days to fix

                                  File emitter.py has 952 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  # SPDX-License-Identifier: MIT
                                  
                                  # Emitter expects events obeying the following grammar:
                                  # stream ::= STREAM-START document* STREAM-END
                                  # document ::= DOCUMENT-START node DOCUMENT-END
                                  Severity: Major
                                  Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 2 days to fix

                                    File scanner.py has 891 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    # SPDX-License-Identifier: MIT
                                    
                                    # Scanner produces tokens of the following types:
                                    # STREAM-START
                                    # STREAM-END
                                    Severity: Major
                                    Found in src/collectors/python.d.plugin/python_modules/pyyaml2/scanner.py - About 2 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language