gopheracademy/gcon

View on GitHub
assets/admin/pages/scripts/charts-amcharts.js

Summary

Maintainability
F
1 mo
Test Coverage

Function ChartsAmcharts has 3129 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ChartsAmcharts = function() {

    var initChartSample1 = function() {
        var chart = AmCharts.makeChart("chart_1", {
            "type": "serial",
Severity: Major
Found in assets/admin/pages/scripts/charts-amcharts.js - About 2 wks to fix

    Function initChartSample10 has 1864 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var initChartSample10 = function() {
            /*
                although ammap has methos like getAreaCenterLatitude and getAreaCenterLongitude,
                they are not suitable in quite a lot of cases as the center of some countries
                is even outside the country itself (like US, because of Alaska and Hawaii)
    Severity: Major
    Found in assets/admin/pages/scripts/charts-amcharts.js - About 1 wk to fix

      File charts-amcharts.js has 3134 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var ChartsAmcharts = function() {
      
          var initChartSample1 = function() {
              var chart = AmCharts.makeChart("chart_1", {
                  "type": "serial",
      Severity: Major
      Found in assets/admin/pages/scripts/charts-amcharts.js - About 1 wk to fix

        Function initChartSample11 has 249 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var initChartSample11 = function() {
                // svg path for target icon
                var targetSVG = "M9,0C4.029,0,0,4.029,0,9s4.029,9,9,9s9-4.029,9-9S13.971,0,9,0z M9,15.93 c-3.83,0-6.93-3.1-6.93-6.93S5.17,2.07,9,2.07s6.93,3.1,6.93,6.93S12.83,15.93,9,15.93 M12.5,9c0,1.933-1.567,3.5-3.5,3.5S5.5,10.933,5.5,9S7.067,5.5,9,5.5 S12.5,7.067,12.5,9z";
                // svg path for plane icon
                var planeSVG = "M19.671,8.11l-2.777,2.777l-3.837-0.861c0.362-0.505,0.916-1.683,0.464-2.135c-0.518-0.517-1.979,0.278-2.305,0.604l-0.913,0.913L7.614,8.804l-2.021,2.021l2.232,1.061l-0.082,0.082l1.701,1.701l0.688-0.687l3.164,1.504L9.571,18.21H6.413l-1.137,1.138l3.6,0.948l1.83,1.83l0.947,3.598l1.137-1.137V21.43l3.725-3.725l1.504,3.164l-0.687,0.687l1.702,1.701l0.081-0.081l1.062,2.231l2.02-2.02l-0.604-2.689l0.912-0.912c0.326-0.326,1.121-1.789,0.604-2.306c-0.452-0.452-1.63,0.101-2.135,0.464l-0.861-3.838l2.777-2.777c0.947-0.947,3.599-4.862,2.62-5.839C24.533,4.512,20.618,7.163,19.671,8.11z";
        Severity: Major
        Found in assets/admin/pages/scripts/charts-amcharts.js - About 1 day to fix

          Function initChartSample2 has 231 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var initChartSample2 = function() {
                  var chart = AmCharts.makeChart("chart_2", {
                      "type": "serial",
                      "theme": "light",
          
          Severity: Major
          Found in assets/admin/pages/scripts/charts-amcharts.js - About 1 day to fix

            Function initChartSample12 has 161 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var initChartSample12 = function() {
                    var chartData = [];
                    generateChartData();
            
                    function generateChartData() {
            Severity: Major
            Found in assets/admin/pages/scripts/charts-amcharts.js - About 6 hrs to fix

              Function initChartSample5 has 124 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var initChartSample5 = function() {
                      var chart = AmCharts.makeChart("chart_5", {
                          "theme": "light",
                          "type": "serial",
                          "startDuration": 2,
              Severity: Major
              Found in assets/admin/pages/scripts/charts-amcharts.js - About 4 hrs to fix

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

                    var initChartSample3 = function() {
                        var chart = AmCharts.makeChart("chart_3", {
                            "type": "serial",
                            "theme": "light",
                
                Severity: Major
                Found in assets/admin/pages/scripts/charts-amcharts.js - About 4 hrs to fix

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

                      var initChartSample1 = function() {
                          var chart = AmCharts.makeChart("chart_1", {
                              "type": "serial",
                              "theme": "light",
                              "pathToImages": App.getGlobalPluginsPath() + "amcharts/amcharts/images/",
                  Severity: Major
                  Found in assets/admin/pages/scripts/charts-amcharts.js - About 3 hrs to fix

                    Function initChartSample8 has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var initChartSample8 = function() {
                            var chart = AmCharts.makeChart("chart_8", {
                                "type": "radar",
                                "theme": "light",
                    
                    Severity: Major
                    Found in assets/admin/pages/scripts/charts-amcharts.js - About 2 hrs to fix

                      Function initChartSample4 has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var initChartSample4 = function() {
                              var chart = AmCharts.makeChart("chart_4", {
                                  "type": "serial",
                                  "theme": "light",
                      
                      Severity: Major
                      Found in assets/admin/pages/scripts/charts-amcharts.js - About 2 hrs to fix

                        Function initChartSample7 has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var initChartSample7 = function() {
                                var chart = AmCharts.makeChart("chart_7", {
                                    "type": "pie",
                                    "theme": "light",
                        
                        Severity: Major
                        Found in assets/admin/pages/scripts/charts-amcharts.js - About 2 hrs to fix

                          Function initChartSample9 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var initChartSample9 = function() {
                                  var chart = AmCharts.makeChart("chart_9", {
                                      "type": "radar",
                                      "theme": "light",
                          
                          Severity: Minor
                          Found in assets/admin/pages/scripts/charts-amcharts.js - About 1 hr to fix

                            Function initChartSample6 has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var initChartSample6 = function() {
                                    var chart = AmCharts.makeChart("chart_6", {
                                        "type": "pie",
                                        "theme": "light",
                            
                            Severity: Minor
                            Found in assets/admin/pages/scripts/charts-amcharts.js - About 1 hr to fix

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

                              var ChartsAmcharts = function() {
                              
                                  var initChartSample1 = function() {
                                      var chart = AmCharts.makeChart("chart_1", {
                                          "type": "serial",
                              Severity: Minor
                              Found in assets/admin/pages/scripts/charts-amcharts.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

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

                                      jQuery('.chart_7_chart_input').off().on('input change', function() {
                                          var property = jQuery(this).data('property');
                                          var target = chart;
                                          var value = Number(this.value);
                                          chart.startDuration = 0;
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 2 other locations - About 4 hrs to fix
                              assets/admin/layouts/layout6/scripts/index.js on lines 123..135
                              assets/admin/pages/scripts/dashboard.js on lines 1297..1309

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

                              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

                                  return {
                                      //main function to initiate the module
                              
                                      init: function() {
                              
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 1 other location - About 2 hrs to fix
                              assets/admin/pages/scripts/components-form-tools-2.js on lines 567..584

                              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

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

                                              "dateFormats": [{
                                                  "period": "DD",
                                                  "format": "DD"
                                              }, {
                                                  "period": "WW",
                              Severity: Minor
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 1 other location - About 55 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 405..417

                              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

                                              "dateFormats": [{
                                                  "period": "DD",
                                                  "format": "DD"
                                              }, {
                                                  "period": "WW",
                              Severity: Minor
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 1 other location - About 55 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 289..301

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_3').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_4').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_5').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_6').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_11').closest('.portlet').find('.fullscreen').click(function() {
                                          map.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_8').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_10').closest('.portlet').find('.fullscreen').click(function() {
                                          map.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_2').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_1').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_7').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_9').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3223..3225

                              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 12 locations. Consider refactoring.
                              Open

                                      $('#chart_12').closest('.portlet').find('.fullscreen').click(function() {
                                          chart.invalidateSize();
                                      });
                              Severity: Major
                              Found in assets/admin/pages/scripts/charts-amcharts.js and 11 other locations - About 35 mins to fix
                              assets/admin/pages/scripts/charts-amcharts.js on lines 82..84
                              assets/admin/pages/scripts/charts-amcharts.js on lines 319..321
                              assets/admin/pages/scripts/charts-amcharts.js on lines 426..428
                              assets/admin/pages/scripts/charts-amcharts.js on lines 500..502
                              assets/admin/pages/scripts/charts-amcharts.js on lines 635..637
                              assets/admin/pages/scripts/charts-amcharts.js on lines 687..689
                              assets/admin/pages/scripts/charts-amcharts.js on lines 748..750
                              assets/admin/pages/scripts/charts-amcharts.js on lines 827..829
                              assets/admin/pages/scripts/charts-amcharts.js on lines 882..884
                              assets/admin/pages/scripts/charts-amcharts.js on lines 2774..2776
                              assets/admin/pages/scripts/charts-amcharts.js on lines 3043..3045

                              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

                              There are no issues that match your filters.

                              Category
                              Status