netdata/netdata

View on GitHub
src/web/gui/main.js

Summary

Maintainability
F
1 mo
Test Coverage

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 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 runOnceOnDashboardWithjQuery has 281 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function runOnceOnDashboardWithjQuery() {
          if (runOnceOnDashboardLastRun !== 0) {
              scrollDashboardTo();
      
              // restore the scrollspy at the proper position
      Severity: Major
      Found in src/web/gui/main.js - About 1 day to fix

        Function headMain has 181 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function headMain(os, charts, duration) {
            void (os);
        
            if (urlOptions.mode === 'print') {
                return '';
        Severity: Major
        Found in src/web/gui/main.js - About 7 hrs to fix

          Function saveSnapshot has 164 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function saveSnapshot() {
              loadPako(function () {
                  loadLzString(function () {
                      saveSnapshotStop = false;
                      $('#saveSnapshotModalProgressSection').show();
          Severity: Major
          Found in src/web/gui/main.js - About 6 hrs to fix

            Function renderPage has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

            function renderPage(menus, data) {
                var div = document.getElementById('charts_div');
                var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
            
                // find the proper duration for per-second updates
            Severity: Minor
            Found in src/web/gui/main.js - About 6 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 enrichChartData has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

            function enrichChartData(chart) {
                var parts = chart.type.split('_');
                var tmp = parts[0];
            
                switch (tmp) {
            Severity: Minor
            Found in src/web/gui/main.js - About 6 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 dashboardSettingsSetup has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

            function dashboardSettingsSetup() {
                var update_options_modal = function () {
                    // console.log('update_options_modal');
            
                    var sync_option = function (option) {
            Severity: Minor
            Found in src/web/gui/main.js - About 6 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 renderChartsAndMenu has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

            function renderChartsAndMenu(data) {
                options.menus = {};
                options.submenu_names = {};
            
                var menus = options.menus;
            Severity: Minor
            Found in src/web/gui/main.js - About 5 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 dashboardSettingsSetup has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function dashboardSettingsSetup() {
                var update_options_modal = function () {
                    // console.log('update_options_modal');
            
                    var sync_option = function (option) {
            Severity: Major
            Found in src/web/gui/main.js - About 4 hrs to fix

              Function parseHash has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  parseHash: function () {
                      var variables = document.location.hash.split(';');
                      var len = variables.length;
                      while (len--) {
                          if (len !== 0) {
              Severity: Minor
              Found in src/web/gui/main.js - About 4 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 renderPage has 115 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function renderPage(menus, data) {
                  var div = document.getElementById('charts_div');
                  var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
              
                  // find the proper duration for per-second updates
              Severity: Major
              Found in src/web/gui/main.js - About 4 hrs to fix

                Function shorten has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.fn.shorten = function (settings) {
                        "use strict";
                
                        var config = {
                            showChars: 750,
                Severity: Major
                Found in src/web/gui/main.js - About 4 hrs to fix

                  Function renderMachines has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function renderMachines(machinesArray) {
                      let html = `<div class="info-item">My nodes</div>`;
                  
                      if (machinesArray === null) {
                          let ret = loadLocalStorage("registryCallback");
                  Severity: Major
                  Found in src/web/gui/main.js - About 4 hrs to fix

                    Function enrichChartData has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function enrichChartData(chart) {
                        var parts = chart.type.split('_');
                        var tmp = parts[0];
                    
                        switch (tmp) {
                    Severity: Major
                    Found in src/web/gui/main.js - About 4 hrs to fix

                      Function renderMachines has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderMachines(machinesArray) {
                          let html = `<div class="info-item">My nodes</div>`;
                      
                          if (machinesArray === null) {
                              let ret = loadLocalStorage("registryCallback");
                      Severity: Minor
                      Found in src/web/gui/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 parseHash has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          parseHash: function () {
                              var variables = document.location.hash.split(';');
                              var len = variables.length;
                              while (len--) {
                                  if (len !== 0) {
                      Severity: Major
                      Found in src/web/gui/main.js - About 3 hrs to fix

                        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

                          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 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 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 loadSnapshot has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function loadSnapshot() {
                                $('#loadSnapshotImport').addClass('disabled');
                            
                                if (tmpSnapshotData === null) {
                                    loadSnapshotPreflightEmpty();
                            Severity: Major
                            Found in src/web/gui/main.js - About 2 hrs to fix

                              Function renderChartsAndMenu has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function renderChartsAndMenu(data) {
                                  options.menus = {};
                                  options.submenu_names = {};
                              
                                  var menus = options.menus;
                              Severity: Major
                              Found in src/web/gui/main.js - About 2 hrs to fix

                                Function saveSnapshotModalInit has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function saveSnapshotModalInit() {
                                    $('#saveSnapshotModalProgressSection').hide();
                                    $('#saveSnapshotResolutionRadio').show();
                                    saveSnapshotModalLog('info', 'Select resolution and click <b>Save</b>');
                                    $('#saveSnapshotExport').removeClass('disabled');
                                Severity: Major
                                Found in src/web/gui/main.js - About 2 hrs to fix

                                  Function update_options_modal has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      var update_options_modal = function () {
                                          // console.log('update_options_modal');
                                  
                                          var sync_option = function (option) {
                                              var self = $('#' + option);
                                  Severity: Major
                                  Found in src/web/gui/main.js - About 2 hrs to fix

                                    Function versionsMatch has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function versionsMatch(v1, v2) {
                                        if (v1 == v2) {
                                            return true;
                                        } else {
                                            let s1 = v1.split('.');
                                    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 mergeAgents has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function mergeAgents(cloud, local) {
                                        let dirty = false;
                                    
                                        const union = new Map();
                                    
                                    
                                    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 renderStreamedHosts has 55 lines of code (exceeds 25 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: Major
                                    Found in src/web/gui/main.js - About 2 hrs to fix

                                      Function printPage has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function printPage() {
                                          var print_is_rendering = true;
                                      
                                          $('#printModal').on('hide.bs.modal', function (e) {
                                              if (print_is_rendering === true) {
                                      Severity: Major
                                      Found in src/web/gui/main.js - About 2 hrs to fix

                                        Function runOnceOnDashboardWithjQuery has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function runOnceOnDashboardWithjQuery() {
                                            if (runOnceOnDashboardLastRun !== 0) {
                                                scrollDashboardTo();
                                        
                                                // restore the scrollspy at the proper position
                                        Severity: Minor
                                        Found in src/web/gui/main.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 finalizePage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function finalizePage() {
                                            // resize all charts - without starting the background thread
                                            // this has to be done while NETDATA is paused
                                            // if we omit this, the affix menu will be wrong, since all
                                            // the Dom elements are initially zero-sized
                                        Severity: Minor
                                        Found in src/web/gui/main.js - About 1 hr to fix

                                          Function postCloudAccountAgents has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          function postCloudAccountAgents(agentsToSync) {
                                              if (!isSignedIn()) {
                                                  return [];
                                              }
                                          
                                          
                                          Severity: Minor
                                          Found in src/web/gui/main.js - About 1 hr to fix

                                            Function initializeDynamicDashboardWithData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function initializeDynamicDashboardWithData(data) {
                                                if (data !== null) {
                                                    options.hostname = data.hostname;
                                                    options.data = data;
                                                    options.version = data.version;
                                            Severity: Minor
                                            Found in src/web/gui/main.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 loadSnapshotPreflightFile has a Cognitive Complexity of 14 (exceeds 5 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

                                            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 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

                                              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 gotoServerValidateUrl has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                function gotoServerValidateUrl(id, guid, url) {
                                                    var penalty = 0;
                                                    var error = 'failed';
                                                
                                                    if (document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
                                                Severity: Minor
                                                Found in src/web/gui/main.js - About 1 hr to fix

                                                  Function netdataHighlightCallback has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      netdataHighlightCallback: function (status, after, before) {
                                                          //console.log(2);
                                                          //console.log(new Error().stack);
                                                  
                                                          if (status === true && (after === null || before === null || after <= 0 || before <= 0 || after >= before)) {
                                                  Severity: Minor
                                                  Found in src/web/gui/main.js - About 1 hr to fix

                                                    Function onload has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        fr.onload = function (e) {
                                                            document.getElementById('loadSnapshotFilename').innerHTML = filename;
                                                            var result = null;
                                                            try {
                                                                result = NETDATA.xss.checkAlways('snapshot', JSON.parse(e.target.result), /^(snapshot\.info|snapshot\.data)$/);
                                                    Severity: Minor
                                                    Found in src/web/gui/main.js - About 1 hr to fix

                                                      Function notifyForUpdate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      function notifyForUpdate(force) {
                                                          versionLog('<p>checking for updates...</p>');
                                                      
                                                          var now = Date.now();
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in src/web/gui/main.js - About 1 hr to fix

                                                        Function getCloudAccountAgents has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        function getCloudAccountAgents() {
                                                            if (!isSignedIn()) {
                                                                return [];
                                                            }
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in src/web/gui/main.js - About 1 hr to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                      if (document.location.hostname.endsWith('.my-netdata.io') ||
                                                                          document.location.hostname.endsWith('.mynetdata.io') ||
                                                                          document.location.hostname.endsWith('.netdata.rocks') ||
                                                                          document.location.hostname.endsWith('.netdata.ai') ||
                                                                          document.location.hostname.endsWith('.netdata.live') ||
                                                          Severity: Critical
                                                          Found in src/web/gui/main.js - About 1 hr to fix

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

                                                              Function gotoServerModalHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                              function gotoServerModalHandler(guid) {
                                                                  // console.log('goto server: ' + guid);
                                                              
                                                                  gotoServerStop = false;
                                                                  var checked = {};
                                                              Severity: Minor
                                                              Found in src/web/gui/main.js - About 1 hr to fix

                                                                Function initializeDynamicDashboardWithData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                function initializeDynamicDashboardWithData(data) {
                                                                    if (data !== null) {
                                                                        options.hostname = data.hostname;
                                                                        options.data = data;
                                                                        options.version = data.version;
                                                                Severity: Minor
                                                                Found in src/web/gui/main.js - About 1 hr to fix

                                                                  Function naturalSortCompare has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                  function naturalSortCompare(a, b) {
                                                                      var aa = naturalSortChunkify(a.toLowerCase());
                                                                      var bb = naturalSortChunkify(b.toLowerCase());
                                                                  
                                                                      for (var x = 0; aa[x] && bb[x]; x++) {
                                                                  Severity: Minor
                                                                  Found in src/web/gui/main.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 netdataHighlightCallback has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                      netdataHighlightCallback: function (status, after, before) {
                                                                          //console.log(2);
                                                                          //console.log(new Error().stack);
                                                                  
                                                                          if (status === true && (after === null || before === null || after <= 0 || before <= 0 || after >= before)) {
                                                                  Severity: Minor
                                                                  Found in src/web/gui/main.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 renderMyNetdataMenu has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                  function renderMyNetdataMenu(machinesArray) {
                                                                      const el = document.getElementById('my-netdata-dropdown-content');
                                                                      el.classList.add(`theme-${netdataTheme}`);
                                                                  
                                                                      if (machinesArray == registryAgents) {
                                                                  Severity: Minor
                                                                  Found in src/web/gui/main.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 notifyForDeleteRegistry has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                  function notifyForDeleteRegistry() {
                                                                      const responseEl = document.getElementById('deleteRegistryResponse');
                                                                  
                                                                      if (deleteRegistryUrl) {
                                                                          if (isSignedIn()) {
                                                                  Severity: Minor
                                                                  Found in src/web/gui/main.js - About 1 hr to fix

                                                                    Function headMain has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                    function headMain(os, charts, duration) {
                                                                        void (os);
                                                                    
                                                                        if (urlOptions.mode === 'print') {
                                                                            return '';
                                                                    Severity: Minor
                                                                    Found in src/web/gui/main.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 mergeAgents has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                    function mergeAgents(cloud, local) {
                                                                        let dirty = false;
                                                                    
                                                                        const union = new Map();
                                                                    
                                                                    
                                                                    Severity: Minor
                                                                    Found in src/web/gui/main.js - About 1 hr to fix

                                                                      Function syncAgents has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                      function syncAgents(callback) {
                                                                          const json = localStorage.getItem("cloud.sync");
                                                                          const sync = json ? JSON.parse(json) : {};
                                                                      
                                                                          const currentAgent = {
                                                                      Severity: Minor
                                                                      Found in src/web/gui/main.js - About 1 hr to fix

                                                                        Function netdataPrepCallback has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                        var netdataPrepCallback = function () {
                                                                            NETDATA.requiredCSS.push({
                                                                                url: NETDATA.serverStatic + 'css/bootstrap-toggle-2.2.2.min.css',
                                                                                isAlreadyLoaded: function () {
                                                                                    return false;
                                                                        Severity: Minor
                                                                        Found in src/web/gui/main.js - About 1 hr to fix

                                                                          Function getGCSLatestVersion has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                          function getGCSLatestVersion(callback) {
                                                                              versionLog('Downloading latest version id from GCS...');
                                                                              $.ajax({
                                                                                  url: "https://www.googleapis.com/storage/v1/b/netdata-nightlies/o/latest-version.txt",
                                                                                  async: true,
                                                                          Severity: Minor
                                                                          Found in src/web/gui/main.js - About 1 hr to fix

                                                                            Function generateHeadCharts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            function generateHeadCharts(type, chart, duration) {
                                                                                if (urlOptions.mode === 'print') {
                                                                                    return '';
                                                                                }
                                                                            
                                                                            
                                                                            Severity: Minor
                                                                            Found in src/web/gui/main.js - About 45 mins 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 genHash has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                                genHash: function (forReload) {
                                                                                    var hash = urlOptions.hash;
                                                                            
                                                                                    if (urlOptions.pan_and_zoom === true) {
                                                                                        hash += ';after=' + urlOptions.after.toString() +
                                                                            Severity: Minor
                                                                            Found in src/web/gui/main.js - About 45 mins 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 sparkline has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                                sparkline: function (prefix, chart, dimension, units, suffix) {
                                                                                    if (options.data === null || typeof options.data.charts === 'undefined') {
                                                                                        return '';
                                                                                    }
                                                                            
                                                                            
                                                                            Severity: Minor
                                                                            Found in src/web/gui/main.js - About 45 mins 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

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                        if (countChars <= config.showChars) {
                                                                                                            bag += content.charAt(i); // Fix to ie 7 not allowing you to reference string characters using the []
                                                                                                            countChars++;
                                                                                                        } else {
                                                                                                            // Now I have the characters needed
                                                                            Severity: Major
                                                                            Found in src/web/gui/main.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                          if (tagName[0] === '/') {
                                                                              
                                                                                                              if (tagName !== ('/' + openTags[0])) {
                                                                                                                  config.errMsg = 'ERROR en HTML: the top of the stack should be the tag that closes';
                                                                                                              } else {
                                                                              Severity: Major
                                                                              Found in src/web/gui/main.js - About 45 mins to fix

                                                                                Consider simplifying this complex logical expression.
                                                                                Open

                                                                                        if (status === true && (after === null || before === null || after <= 0 || before <= 0 || after >= before)) {
                                                                                            status = false;
                                                                                            after = 0;
                                                                                            before = 0;
                                                                                        }
                                                                                Severity: Major
                                                                                Found in src/web/gui/main.js - About 40 mins to fix

                                                                                  Consider simplifying this complex logical expression.
                                                                                  Open

                                                                                              if (typeof tmpSnapshotData.highlight_after_ms !== 'undefined'
                                                                                                  && tmpSnapshotData.highlight_after_ms !== null
                                                                                                  && tmpSnapshotData.highlight_after_ms > 0
                                                                                                  && typeof tmpSnapshotData.highlight_before_ms !== 'undefined'
                                                                                                  && tmpSnapshotData.highlight_before_ms !== null
                                                                                  Severity: Major
                                                                                  Found in src/web/gui/main.js - About 40 mins to fix

                                                                                    Function sparkline has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                        sparkline: function (prefix, chart, dimension, units, suffix) {
                                                                                    Severity: Minor
                                                                                    Found in src/web/gui/main.js - About 35 mins to fix

                                                                                      Function alarmsCallback has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                      Open

                                                                                      function alarmsCallback(data) {
                                                                                          var count = 0, x;
                                                                                          for (x in data.alarms) {
                                                                                              if (!data.alarms.hasOwnProperty(x)) {
                                                                                                  continue;
                                                                                      Severity: Minor
                                                                                      Found in src/web/gui/main.js - About 35 mins 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

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                              else return true;
                                                                                      Severity: Major
                                                                                      Found in src/web/gui/main.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                if (n1 < n2) return false;
                                                                                        Severity: Major
                                                                                        Found in src/web/gui/main.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                  return prefix + '<div class="netdata-container" data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')' + suffix;
                                                                                          Severity: Major
                                                                                          Found in src/web/gui/main.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                    else if (n1 > n2) return true;
                                                                                            Severity: Major
                                                                                            Found in src/web/gui/main.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                      else if (n1 > n2) return true;
                                                                                              Severity: Major
                                                                                              Found in src/web/gui/main.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                        if (n1 < n2) return false;
                                                                                                Severity: Major
                                                                                                Found in src/web/gui/main.js - About 30 mins to fix

                                                                                                  Function notifyForUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                  function notifyForUpdate(force) {
                                                                                                      versionLog('<p>checking for updates...</p>');
                                                                                                  
                                                                                                      var now = Date.now();
                                                                                                  
                                                                                                  
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js - About 25 mins 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

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      else if (typeof charts['system.ipv4'] !== 'undefined') {
                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.ipv4"'
                                                                                                              + ' data-dimensions="received"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="IPv4 Inbound"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 5 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1514..1559
                                                                                                  src/web/gui/main.js on lines 1537..1559
                                                                                                  src/web/gui/main.js on lines 1574..1667
                                                                                                  src/web/gui/main.js on lines 1597..1667

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 150.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      else if (typeof charts['system.pgpgio'] !== 'undefined') {
                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.pgpgio"'
                                                                                                              + ' data-dimensions="in"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="Disk Read"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 5 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1514..1559
                                                                                                  src/web/gui/main.js on lines 1574..1667
                                                                                                  src/web/gui/main.js on lines 1597..1667
                                                                                                  src/web/gui/main.js on lines 1620..1667

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 150.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      if (typeof charts['system.net'] !== 'undefined') {
                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.net"'
                                                                                                              + ' data-dimensions="received"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="Net Inbound"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 5 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1514..1559
                                                                                                  src/web/gui/main.js on lines 1537..1559
                                                                                                  src/web/gui/main.js on lines 1597..1667
                                                                                                  src/web/gui/main.js on lines 1620..1667

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 150.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      if (typeof charts['system.io'] !== 'undefined') {
                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.io"'
                                                                                                              + ' data-dimensions="in"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="Disk Read"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 5 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1537..1559
                                                                                                  src/web/gui/main.js on lines 1574..1667
                                                                                                  src/web/gui/main.js on lines 1597..1667
                                                                                                  src/web/gui/main.js on lines 1620..1667

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 150.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      else if (typeof charts['system.ip'] !== 'undefined') {
                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.ip"'
                                                                                                              + ' data-dimensions="received"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="IP Inbound"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 5 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1514..1559
                                                                                                  src/web/gui/main.js on lines 1537..1559
                                                                                                  src/web/gui/main.js on lines 1574..1667
                                                                                                  src/web/gui/main.js on lines 1620..1667

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 150.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                  } else {
                                                                                                                      $this.addClass('less');
                                                                                                                      $this.html(config.lessText);
                                                                                                                      $this.parent().prev().animate({ 'height': '100' + '%' }, 0, function () {
                                                                                                                          $this.parent().prev().prev().hide();
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 4 hrs to fix
                                                                                                  src/web/gui/main.js on lines 4331..4339

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 126.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                  if ($this.hasClass('less')) {
                                                                                                                      $this.removeClass('less');
                                                                                                                      $this.html(config.moreText);
                                                                                                                      $this.parent().prev().animate({ 'height': '0' + '%' }, 0, function () {
                                                                                                                          $this.parent().prev().prev().show();
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 4 hrs to fix
                                                                                                  src/web/gui/main.js on lines 4339..4347

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 126.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      return fetch(
                                                                                                          `${NETDATA.registry.cloudBaseURL}/api/v1/accounts/${cloudAccountID}/agents`,
                                                                                                          {
                                                                                                              method: "POST",
                                                                                                              mode: "cors",
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 4 hrs to fix
                                                                                                  src/web/gui/main.js on lines 4666..4695

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 123.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      return fetch(
                                                                                                          `${NETDATA.registry.cloudBaseURL}/api/v1/accounts/${cloudAccountID}/agents`,
                                                                                                          {
                                                                                                              method: "GET",
                                                                                                              mode: "cors",
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 4 hrs to fix
                                                                                                  src/web/gui/main.js on lines 4755..4783

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 123.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          case 'bind':
                                                                                                              chart.menu = chart.type;
                                                                                                              if (parts.length > 2 && parts[1] === 'rndc') {
                                                                                                                  chart.menu_pattern = tmp + '_' + parts[1];
                                                                                                              } else if (parts.length > 1) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1376..1383
                                                                                                  src/web/gui/main.js on lines 1403..1410
                                                                                                  src/web/gui/main.js on lines 1420..1427
                                                                                                  src/web/gui/main.js on lines 1439..1446

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 97.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          case 'apache':
                                                                                                              chart.menu = chart.type;
                                                                                                              if (parts.length > 2 && parts[1] === 'cache') {
                                                                                                                  chart.menu_pattern = tmp + '_' + parts[1];
                                                                                                              } else if (parts.length > 1) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1385..1392
                                                                                                  src/web/gui/main.js on lines 1403..1410
                                                                                                  src/web/gui/main.js on lines 1420..1427
                                                                                                  src/web/gui/main.js on lines 1439..1446

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 97.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          case 'web':
                                                                                                              chart.menu = chart.type;
                                                                                                              if (parts.length > 2 && parts[1] === 'log') {
                                                                                                                  chart.menu_pattern = tmp + '_' + parts[1];
                                                                                                              } else if (parts.length > 1) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1376..1383
                                                                                                  src/web/gui/main.js on lines 1385..1392
                                                                                                  src/web/gui/main.js on lines 1403..1410
                                                                                                  src/web/gui/main.js on lines 1420..1427

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 97.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          case 'isc':
                                                                                                              chart.menu = chart.type;
                                                                                                              if (parts.length > 2 && parts[1] === 'dhcpd') {
                                                                                                                  chart.menu_pattern = tmp + '_' + parts[1];
                                                                                                              } else if (parts.length > 1) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1376..1383
                                                                                                  src/web/gui/main.js on lines 1385..1392
                                                                                                  src/web/gui/main.js on lines 1403..1410
                                                                                                  src/web/gui/main.js on lines 1439..1446

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 97.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          case 'go':
                                                                                                              chart.menu = chart.type;
                                                                                                              if (parts.length > 2 && parts[1] === 'expvar') {
                                                                                                                  chart.menu_pattern = tmp + '_' + parts[1];
                                                                                                              } else if (parts.length > 1) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1376..1383
                                                                                                  src/web/gui/main.js on lines 1385..1392
                                                                                                  src/web/gui/main.js on lines 1420..1427
                                                                                                  src/web/gui/main.js on lines 1439..1446

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 97.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'value',
                                                                                                                          title: 'Value',
                                                                                                                          titleTooltip: 'The value of the alarm, that triggered this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2524..2537

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 96.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'old_value',
                                                                                                                          title: 'Old Value',
                                                                                                                          titleTooltip: 'The value of the alarm, just before this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 3 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2538..2551

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 96.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'duration',
                                                                                                                          title: 'Last Duration',
                                                                                                                          titleTooltip: 'The duration the alarm was at its previous state, just before this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 2 other locations - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2593..2606
                                                                                                  src/web/gui/main.js on lines 2724..2738

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 88.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'non_clear_duration',
                                                                                                                          title: 'Raised Duration',
                                                                                                                          titleTooltip: 'The duration the alarm was raised, just before this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 2 other locations - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2579..2592
                                                                                                  src/web/gui/main.js on lines 2724..2738

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 88.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'delay',
                                                                                                                          title: 'Script Delay',
                                                                                                                          titleTooltip: 'The hysteresis of the notification',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 2 other locations - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2579..2592
                                                                                                  src/web/gui/main.js on lines 2593..2606

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 88.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'updated',
                                                                                                                          title: 'Updated Status',
                                                                                                                          titleTooltip: 'True when this event has been updated by another event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2616..2634

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 81.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'processed',
                                                                                                                          title: 'Processed Status',
                                                                                                                          titleTooltip: 'True when this event is processed',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 2635..2653

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 81.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      var sizemb = Math.round(
                                                                                                          (options.data.charts_count * snapshotOptions.bytes_per_chart
                                                                                                              + options.data.dimensions_count * points * snapshotOptions.compressions[saveSnapshotCompression].bytes_per_point_disk)
                                                                                                          * 10 / 1024 / 1024) / 10;
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 3523..3526

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 79.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      var memmb = Math.round(
                                                                                                          (options.data.charts_count * snapshotOptions.bytes_per_chart
                                                                                                              + options.data.dimensions_count * points * snapshotOptions.compressions[saveSnapshotCompression].bytes_per_point_memory)
                                                                                                          * 10 / 1024 / 1024) / 10;
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 3518..3521

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 79.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          'lzstring.base64': {
                                                                                                              bytes_per_point_memory: 2.1,
                                                                                                              bytes_per_point_disk: 2.3,
                                                                                                  
                                                                                                              compress: function (s) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 3272..3287

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 78.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          'lzstring.uri': {
                                                                                                              bytes_per_point_memory: 2.1,
                                                                                                              bytes_per_point_disk: 2.3,
                                                                                                  
                                                                                                              compress: function (s) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 3255..3270

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 78.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.ipv6"'
                                                                                                              + ' data-dimensions="sent"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="IPv6 Outbound"'
                                                                                                              + ' data-units="kbps"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1644..1654

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 77.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.ipv6"'
                                                                                                              + ' data-dimensions="received"'
                                                                                                              + ' data-chart-library="easypiechart"'
                                                                                                              + ' data-title="IPv6 Inbound"'
                                                                                                              + ' data-units="kbps"'
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 1656..1666

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 77.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      Ps.initialize(document.getElementById('sidebar'), {
                                                                                                          wheelSpeed: 0.5,
                                                                                                          wheelPropagation: true,
                                                                                                          swipePropagation: true,
                                                                                                          minScrollbarLength: null,
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 4225..4237

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 75.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      Ps.initialize(document.getElementById('my-netdata-dropdown-content'), {
                                                                                                          wheelSpeed: 1,
                                                                                                          wheelPropagation: false,
                                                                                                          swipePropagation: false,
                                                                                                          minScrollbarLength: null,
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 2 hrs to fix
                                                                                                  src/web/gui/main.js on lines 4188..4200

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 75.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                  function chartCommonMin(family, context, units) {
                                                                                                                      var x = netdataDashboard.anyAttribute(netdataDashboard.context, 'commonMin', context, undefined);
                                                                                                                      if (typeof x !== 'undefined') {
                                                                                                                          return ' data-common-min="' + family + '/' + context + '/' + units + '"';
                                                                                                                      } else {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 1782..1789

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 73.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                  function chartCommonMax(family, context, units) {
                                                                                                                      var x = netdataDashboard.anyAttribute(netdataDashboard.context, 'commonMax', context, undefined);
                                                                                                                      if (typeof x !== 'undefined') {
                                                                                                                          return ' data-common-max="' + family + '/' + context + '/' + units + '"';
                                                                                                                      } else {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 1773..1780

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 73.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'exec_run',
                                                                                                                          title: 'Script Run At',
                                                                                                                          titleTooltip: 'The date and time the script has been ran',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2739..2752

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 68.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'delay_up_to_timestamp',
                                                                                                                          title: 'Script Delay Run At',
                                                                                                                          titleTooltip: 'The date and time the script should be run, after hysteresis',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2691..2704

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 68.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'unique_id',
                                                                                                                          title: 'Unique ID',
                                                                                                                          titleTooltip: 'The host unique ID for this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2447..2460
                                                                                                  src/web/gui/main.js on lines 2461..2474
                                                                                                  src/web/gui/main.js on lines 2654..2667
                                                                                                  src/web/gui/main.js on lines 2668..2681

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 67.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'updates_id',
                                                                                                                          title: 'Updates ID',
                                                                                                                          titleTooltip: 'The unique ID of the event obsoleted because of this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2433..2446
                                                                                                  src/web/gui/main.js on lines 2447..2460
                                                                                                  src/web/gui/main.js on lines 2461..2474
                                                                                                  src/web/gui/main.js on lines 2654..2667

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 67.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'alarm_event_id',
                                                                                                                          title: 'Alarm Event ID',
                                                                                                                          titleTooltip: 'The incremental ID of this event for the given alarm',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2433..2446
                                                                                                  src/web/gui/main.js on lines 2447..2460
                                                                                                  src/web/gui/main.js on lines 2654..2667
                                                                                                  src/web/gui/main.js on lines 2668..2681

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 67.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'updated_by_id',
                                                                                                                          title: 'Updated By ID',
                                                                                                                          titleTooltip: 'The unique ID of the event that obsoleted this one',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2433..2446
                                                                                                  src/web/gui/main.js on lines 2447..2460
                                                                                                  src/web/gui/main.js on lines 2461..2474
                                                                                                  src/web/gui/main.js on lines 2668..2681

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 67.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      {
                                                                                                                          field: 'alarm_id',
                                                                                                                          title: 'Alarm ID',
                                                                                                                          titleTooltip: 'The ID of the alarm that generated this event',
                                                                                                                          formatter: function (value, row, index) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 4 other locations - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2433..2446
                                                                                                  src/web/gui/main.js on lines 2461..2474
                                                                                                  src/web/gui/main.js on lines 2654..2667
                                                                                                  src/web/gui/main.js on lines 2668..2681

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 67.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function prioritySort(a, b) {
                                                                                                      if (a.priority < b.priority) {
                                                                                                          return -1;
                                                                                                      }
                                                                                                      if (a.priority > b.priority) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2266..2274

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 66.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          var families_sorted = families_sort.sort(function (a, b) {
                                                                                                              if (a.priority < b.priority) {
                                                                                                                  return -1;
                                                                                                              }
                                                                                                              if (a.priority > b.priority) {
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 1121..1129

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 66.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function xssModalDisableXss() {
                                                                                                      //console.log('disabling xss checks');
                                                                                                      NETDATA.xss.enabled = false;
                                                                                                      NETDATA.xss.enabled_for_data = false;
                                                                                                      initializeConfig.custom_info = true;
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2892..2899

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 60.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              if (self.prop('checked') !== (NETDATA.getOption('temperature') === 'celsius')) {
                                                                                                                  self.bootstrapToggle(NETDATA.getOption('temperature') === 'celsius' ? 'on' : 'off');
                                                                                                              }
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 3867..3869

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 60.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function xssModalKeepXss() {
                                                                                                      //console.log('keeping xss checks');
                                                                                                      NETDATA.xss.enabled = true;
                                                                                                      NETDATA.xss.enabled_for_data = true;
                                                                                                      initializeConfig.custom_info = false;
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 2883..2890

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 60.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              if (self.prop('checked') !== (NETDATA.getOption('units') === 'auto')) {
                                                                                                                  self.bootstrapToggle(NETDATA.getOption('units') === 'auto' ? 'on' : 'off');
                                                                                                              }
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 3882..3884

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 60.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          if (urlOptions.highlight === true) {
                                                                                                              hash += ';highlight_after=' + urlOptions.highlight_after.toString() +
                                                                                                                  ';highlight_before=' + urlOptions.highlight_before.toString();
                                                                                                          }
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 84..87

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 56.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          if (urlOptions.pan_and_zoom === true) {
                                                                                                              hash += ';after=' + urlOptions.after.toString() +
                                                                                                                  ';before=' + urlOptions.before.toString();
                                                                                                          }
                                                                                                  Severity: Major
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 1 hr to fix
                                                                                                  src/web/gui/main.js on lines 89..92

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 56.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      var url = document.location.origin.toString() + document.location.pathname.toString() + document.location.search.toString() + urlOptions.genHash() + ';mode=print';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 3686..3686

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 54.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                  url: ((urlOptions.server !== null) ? urlOptions.server : document.location.origin.toString() + document.location.pathname.toString() + document.location.search.toString()).toString(),
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 3082..3082

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 54.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      if (alarm.delay_up_duration > 0) {
                                                                                                                          delay += 'on&nbsp;escalation&nbsp;<code>' + NETDATA.seconds4human(alarm.delay_up_duration, {
                                                                                                                              space: '&nbsp;',
                                                                                                                              negative_suffix: ''
                                                                                                                          }) + '</code>, ';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 2175..2180

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 54.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                      if (alarm.delay_down_duration > 0) {
                                                                                                                          delay += 'on&nbsp;recovery&nbsp;<code>' + NETDATA.seconds4human(alarm.delay_down_duration, {
                                                                                                                              space: '&nbsp;',
                                                                                                                              negative_suffix: ''
                                                                                                                          }) + '</code>, ';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 2169..2174

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 54.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          var print_options = {
                                                                                                              stop_updates_when_focus_is_lost: false,
                                                                                                              update_only_visible: false,
                                                                                                              sync_selection: false,
                                                                                                              eliminate_zero_dimensions: false,
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 3648..3658

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 53.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              var save_options = {
                                                                                                                  stop_updates_when_focus_is_lost: false,
                                                                                                                  update_only_visible: false,
                                                                                                                  sync_selection: false,
                                                                                                                  eliminate_zero_dimensions: true,
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 3104..3114

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 53.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              document.getElementById('current_timezone').innerText = (NETDATA.options.current.timezone === 'default') ? 'unset, using browser default' : NETDATA.options.current.timezone;
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 4617..4617

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 53.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      document.getElementById('current_timezone').innerText = (NETDATA.options.current.timezone === 'default') ? 'unset, using browser default' : NETDATA.options.current.timezone;
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 55 mins to fix
                                                                                                  src/web/gui/main.js on lines 3891..3891

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 53.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              document.getElementById('alarms_active').innerHTML =
                                                                                                                  document.getElementById('alarms_all').innerHTML =
                                                                                                                  document.getElementById('alarms_log').innerHTML =
                                                                                                                  'loading...';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 50 mins to fix
                                                                                                  src/web/gui/main.js on lines 2056..2059

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 51.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              if (typeof snapshotOptions.compressions[saveData.compression] === 'undefined') {
                                                                                                                  alert('unknown compression method: ' + saveData.compression);
                                                                                                                  saveData.compression = 'none';
                                                                                                              }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 50 mins to fix
                                                                                                  src/web/gui/main.js on lines 3349..3352

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 51.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              if (typeof snapshotOptions.compressions[tmpSnapshotData.compression] === 'undefined') {
                                                                                                                  alert('unknown compression method: ' + tmpSnapshotData.compression);
                                                                                                                  tmpSnapshotData.compression = 'none';
                                                                                                              }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 50 mins to fix
                                                                                                  src/web/gui/main.js on lines 3702..3705

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 51.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              document.getElementById('alarms_active').innerHTML =
                                                                                                                  document.getElementById('alarms_all').innerHTML =
                                                                                                                  document.getElementById('alarms_log').innerHTML =
                                                                                                                  'failed to load alarm data!';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 50 mins to fix
                                                                                                  src/web/gui/main.js on lines 4281..4284

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 51.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      $('#units_conversion').change(function () {
                                                                                                          NETDATA.setOption('units', $(this).prop('checked') ? 'auto' : 'original');
                                                                                                      });
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 45 mins to fix
                                                                                                  src/web/gui/main.js on lines 3971..3973

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 50.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function showSyncModal() {
                                                                                                      document.getElementById("sync-registry-modal-registry").innerHTML = NETDATA.registry.server;
                                                                                                      $("#syncRegistryModal").modal("show");
                                                                                                  }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 45 mins to fix
                                                                                                  src/web/gui/main.js on lines 4994..4997

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 50.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function showSignInModal() {
                                                                                                      document.getElementById("sim-registry").innerHTML = NETDATA.registry.server;
                                                                                                      $("#signInModal").modal("show");
                                                                                                  }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 45 mins to fix
                                                                                                  src/web/gui/main.js on lines 5004..5007

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 50.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                      $('#units_temp').change(function () {
                                                                                                          NETDATA.setOption('temperature', $(this).prop('checked') ? 'celsius' : 'fahrenheit');
                                                                                                      });
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 45 mins to fix
                                                                                                  src/web/gui/main.js on lines 3968..3970

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 50.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                  for (x in backedup_options) {
                                                                                                                      if (backedup_options.hasOwnProperty(x)) {
                                                                                                                          NETDATA.options.current[x] = backedup_options[x];
                                                                                                                      }
                                                                                                                  }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 35 mins to fix
                                                                                                  src/web/gui/main.js on lines 3117..3121

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 47.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          for (x in print_options) {
                                                                                                              if (print_options.hasOwnProperty(x)) {
                                                                                                                  NETDATA.options.current[x] = print_options[x];
                                                                                                              }
                                                                                                          }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 35 mins to fix
                                                                                                  src/web/gui/main.js on lines 3750..3754

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 47.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              shtml += '<div role="section" class="dashboard-section-container" id="' + submenuid + '"><h2 id="' + submenuid + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 35 mins to fix
                                                                                                  src/web/gui/main.js on lines 1751..1751

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 47.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              sidebar += '<li class><a href="#' + submenuid + '" onClick="return scrollToId(\'' + submenuid + '\');">' + menus[menu].submenus[submenu].title + '</a></li>';
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 35 mins to fix
                                                                                                  src/web/gui/main.js on lines 1752..1752

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 47.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function loadSnapshotModalLog(priority, msg) {
                                                                                                      document.getElementById('loadSnapshotStatus').className = "alert alert-" + priority;
                                                                                                      document.getElementById('loadSnapshotStatus').innerHTML = msg;
                                                                                                  }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 35 mins to fix
                                                                                                  src/web/gui/main.js on lines 3508..3511

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 46.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function saveSnapshotModalLog(priority, msg) {
                                                                                                      document.getElementById('saveSnapshotStatus').className = "alert alert-" + priority;
                                                                                                      document.getElementById('saveSnapshotStatus').innerHTML = msg;
                                                                                                  }
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 35 mins to fix
                                                                                                  src/web/gui/main.js on lines 3294..3297

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 46.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function loadClipboard(callback) {
                                                                                                      if (clipboardLoaded === false) {
                                                                                                          clipboardLoaded = true;
                                                                                                          loadJs('lib/clipboard-polyfill-be05dad.js', callback);
                                                                                                      } else {
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 30 mins to fix
                                                                                                  src/web/gui/main.js on lines 2010..2017

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 45.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                  function loadLzString(callback) {
                                                                                                      if (lzStringLoaded === false) {
                                                                                                          lzStringLoaded = true;
                                                                                                          loadJs('lib/lz-string-1.4.4.min.js', callback);
                                                                                                      } else {
                                                                                                  Severity: Minor
                                                                                                  Found in src/web/gui/main.js and 1 other location - About 30 mins to fix
                                                                                                  src/web/gui/main.js on lines 1970..1977

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 45.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  There are no issues that match your filters.

                                                                                                  Category
                                                                                                  Status