gopheracademy/gcon

View on GitHub
assets/admin/pages/scripts/dashboard.js

Summary

Maintainability
F
1 mo
Test Coverage

Function Dashboard has 1268 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Dashboard = function() {

    return {

        initJQVMAP: function() {
Severity: Major
Found in assets/admin/pages/scripts/dashboard.js - About 6 days to fix

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

    var Dashboard = function() {
    
        return {
    
            initJQVMAP: function() {
    Severity: Major
    Found in assets/admin/pages/scripts/dashboard.js - About 3 days to fix

      Function Dashboard has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
      Open

      var Dashboard = function() {
      
          return {
      
              initJQVMAP: function() {
      Severity: Minor
      Found in assets/admin/pages/scripts/dashboard.js - About 1 day 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 initAmChart2 has 256 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              initAmChart2: function() {
                  if (typeof(AmCharts) === 'undefined' || $('#dashboard_amchart_2').size() === 0) {
                      return;
                  }
      
      Severity: Major
      Found in assets/admin/pages/scripts/dashboard.js - About 1 day to fix

        Function initCharts has 209 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                initCharts: function() {
                    if (!jQuery.plot) {
                        return;
                    }
        
        Severity: Major
        Found in assets/admin/pages/scripts/dashboard.js - About 1 day to fix

          Function initAmChart1 has 207 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  initAmChart1: function() {
                      if (typeof(AmCharts) === 'undefined' || $('#dashboard_amchart_1').size() === 0) {
                          return;
                      }
          
          Severity: Major
          Found in assets/admin/pages/scripts/dashboard.js - About 1 day to fix

            Function initAmChart3 has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    initAmChart3: function() {
                        if (typeof(AmCharts) === 'undefined' || $('#dashboard_amchart_3').size() === 0) {
                            return;
                        }
            
            Severity: Major
            Found in assets/admin/pages/scripts/dashboard.js - About 3 hrs to fix

              Function initCalendar has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      initCalendar: function() {
                          if (!jQuery().fullCalendar) {
                              return;
                          }
              
              Severity: Major
              Found in assets/admin/pages/scripts/dashboard.js - About 3 hrs to fix

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

                        initJQVMAP: function() {
                            if (!jQuery().vectorMap) {
                                return;
                            }
                
                Severity: Major
                Found in assets/admin/pages/scripts/dashboard.js - About 3 hrs to fix

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

                          initDashboardDaterange: function() {
                              if (!jQuery().daterangepicker) {
                                  return;
                              }
                  
                  Severity: Major
                  Found in assets/admin/pages/scripts/dashboard.js - About 2 hrs to fix

                    Function initWorldMapStats has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            initWorldMapStats: function() {
                                if ($('#mapplic').size() === 0) {
                                    return;
                                }
                    
                    Severity: Major
                    Found in assets/admin/pages/scripts/dashboard.js - About 2 hrs to fix

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

                              initChat: function() {
                                  var cont = $('#chats');
                                  var list = $('.chats', cont);
                                  var form = $('.chat-form', cont);
                                  var input = $('input', form);
                      Severity: Major
                      Found in assets/admin/pages/scripts/dashboard.js - About 2 hrs to fix

                        Function initAmChart4 has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                initAmChart4: function() {
                                    if (typeof(AmCharts) === 'undefined' || $('#dashboard_amchart_4').size() === 0) {
                                        return;
                                    }
                        
                        Severity: Minor
                        Found in assets/admin/pages/scripts/dashboard.js - About 1 hr to fix

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

                                  initSparklineCharts: function() {
                                      if (!jQuery().sparkline) {
                                          return;
                                      }
                                      $("#sparkline_bar").sparkline([8, 9, 10, 11, 10, 10, 12, 10, 10, 11, 9, 12, 11, 10, 9, 11, 13, 13, 12], {
                          Severity: Minor
                          Found in assets/admin/pages/scripts/dashboard.js - About 1 hr to fix

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

                                    initMorisCharts: function() {
                                        if (Morris.EventEmitter && $('#sales_statistics').size() > 0) {
                                            // Use Morris.Area instead of Morris.Line
                                            dashboardMainChart = Morris.Area({
                                                element: 'sales_statistics',
                            Severity: Minor
                            Found in assets/admin/pages/scripts/dashboard.js - About 1 hr to fix

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

                                          var setMap = function(name) {
                                              var map = jQuery('#vmap_' + name);
                                              
                                              if (map.size() !== 1) {
                                                  return;
                              Severity: Minor
                              Found in assets/admin/pages/scripts/dashboard.js - About 1 hr to fix

                                Function handleClick has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            var handleClick = function(e) {
                                                e.preventDefault();
                                
                                                var text = input.val();
                                                if (text.length == 0) {
                                Severity: Minor
                                Found in assets/admin/pages/scripts/dashboard.js - About 1 hr to fix

                                  Function initEasyPieCharts has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          initEasyPieCharts: function() {
                                              if (!jQuery().easyPieChart) {
                                                  return;
                                              }
                                  
                                  Severity: Minor
                                  Found in assets/admin/pages/scripts/dashboard.js - About 1 hr to fix

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

                                                var map = AmCharts.makeChart("dashboard_amchart_2", {
                                                    type: "map",
                                                    "theme": "light",
                                                    pathToImages: "../assets/global/plugins/amcharts/ammap/images/",
                                    
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 1 wk to fix
                                    assets/admin/layouts/layout5/scripts/index.js on lines 232..495

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

                                    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 chart = AmCharts.makeChart("dashboard_amchart_1", {
                                                    type: "serial",
                                                    fontSize: 12,
                                                    fontFamily: "Open Sans",
                                                    dataDateFormat: "YYYY-MM-DD",
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 3 days to fix
                                    assets/admin/layouts/layout5/scripts/index.js on lines 93..223

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

                                    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 chart = AmCharts.makeChart("dashboard_amchart_3", {
                                                    "type": "serial",
                                                    "addClassNames": true,
                                                    "theme": "light",
                                                    "path": "../assets/global/plugins/amcharts/ammap/images/",
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 2 days to fix
                                    assets/admin/layouts/layout6/scripts/index.js on lines 4..86

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

                                    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 chartData = [{
                                                    "date": "2012-01-05",
                                                    "distance": 480,
                                                    "townName": "Miami",
                                                    "townName2": "Miami",
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 2 days to fix
                                    assets/admin/layouts/layout5/scripts/index.js on lines 4..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 355.

                                    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 chart = AmCharts.makeChart("dashboard_amchart_4", {
                                                    "type": "pie",
                                                    "theme": "light",
                                                    "path": "../assets/global/plugins/amcharts/ammap/images/",
                                                    "dataProvider": [{
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 5 hrs to fix
                                    assets/admin/layouts/layout6/scripts/index.js on lines 90..122

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

                                    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

                                                        {
                                                            xaxis: {
                                                                tickLength: 0,
                                                                tickDecimals: 0,
                                                                mode: "categories",
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 4 hrs to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 370..402

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

                                    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

                                                        {
                                    
                                                            xaxis: {
                                                                tickLength: 0,
                                                                tickDecimals: 0,
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 4 hrs to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 264..295

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

                                    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 (item) {
                                                            if (previousPoint2 != item.dataIndex) {
                                                                previousPoint2 = item.dataIndex;
                                                                $("#tooltip").remove();
                                                                var x = item.datapoint[0].toFixed(2),
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 4 hrs to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 301..314

                                    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 (item) {
                                                            if (previousPoint != item.dataIndex) {
                                                                previousPoint = item.dataIndex;
                                    
                                                                $("#tooltip").remove();
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 4 hrs to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 407..415

                                    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

                                                    while (data.length < totalPoints) {
                                                        var prev = data.length > 0 ? data[data.length - 1] : 50;
                                                        var y = prev + Math.random() * 10 - 5;
                                                        if (y < 0) y = 0;
                                                        if (y > 100) y = 100;
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 4 hrs to fix
                                    assets/admin/pages/scripts/charts-flotcharts.js on lines 28..34

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

                                                jQuery('.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/dashboard.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/charts-amcharts.js on lines 734..746

                                    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

                                                $('#mapplic').mapplic({
                                                    source: '../assets/global/plugins/mapplic/world.json',
                                                    height: 265,
                                                    animate: false,
                                                    sidebar: false,
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 2 hrs to fix
                                    assets/admin/pages/scripts/widgets.js on lines 4..20

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

                                    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

                                                $("#sparkline_bar5").sparkline([8, 9, 10, 11, 10, 10, 12, 10, 10, 11, 9, 12, 11, 10, 9, 11, 13, 13, 12], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '55',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 463..470

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

                                                $("#sparkline_bar").sparkline([8, 9, 10, 11, 10, 10, 12, 10, 10, 11, 9, 12, 11, 10, 9, 11, 13, 13, 12], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '55',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 481..488

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

                                                $("#sparkline_bar2").sparkline([9, 11, 12, 13, 12, 13, 10, 14, 13, 11, 11, 12, 11, 11, 10, 12, 11, 10], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '55',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 490..497

                                    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

                                                $("#sparkline_bar6").sparkline([9, 11, 12, 13, 12, 13, 10, 14, 13, 11, 11, 12, 11, 11, 10, 12, 11, 10], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '55',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 472..479

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

                                                $("#widget_sparkline_bar3").sparkline([8, 7, 9, 8.5, 8, 8.2, 8, 8.5, 9, 8, 9], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '30',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 7 other locations - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 1335..1342
                                    assets/admin/pages/scripts/dashboard.js on lines 1344..1351
                                    assets/admin/pages/scripts/dashboard.js on lines 1362..1369
                                    assets/admin/pages/scripts/widgets.js on lines 24..31
                                    assets/admin/pages/scripts/widgets.js on lines 32..39
                                    assets/admin/pages/scripts/widgets.js on lines 40..47
                                    assets/admin/pages/scripts/widgets.js on lines 48..55

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

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

                                                $("#widget_sparkline_bar2").sparkline([8, 7, 9, 8.5, 8, 8.2, 8, 8.5, 9, 8, 9], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '30',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 7 other locations - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 1335..1342
                                    assets/admin/pages/scripts/dashboard.js on lines 1353..1360
                                    assets/admin/pages/scripts/dashboard.js on lines 1362..1369
                                    assets/admin/pages/scripts/widgets.js on lines 24..31
                                    assets/admin/pages/scripts/widgets.js on lines 32..39
                                    assets/admin/pages/scripts/widgets.js on lines 40..47
                                    assets/admin/pages/scripts/widgets.js on lines 48..55

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

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

                                                $("#widget_sparkline_bar4").sparkline([8, 7, 9, 8.5, 8, 8.2, 8, 8.5, 9, 8, 9], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '30',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 7 other locations - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 1335..1342
                                    assets/admin/pages/scripts/dashboard.js on lines 1344..1351
                                    assets/admin/pages/scripts/dashboard.js on lines 1353..1360
                                    assets/admin/pages/scripts/widgets.js on lines 24..31
                                    assets/admin/pages/scripts/widgets.js on lines 32..39
                                    assets/admin/pages/scripts/widgets.js on lines 40..47
                                    assets/admin/pages/scripts/widgets.js on lines 48..55

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

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

                                                $("#widget_sparkline_bar").sparkline([8, 7, 9, 8.5, 8, 8.2, 8, 8.5, 9, 8, 9], {
                                                    type: 'bar',
                                                    width: '100',
                                                    barWidth: 5,
                                                    height: '30',
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 7 other locations - About 1 hr to fix
                                    assets/admin/pages/scripts/dashboard.js on lines 1344..1351
                                    assets/admin/pages/scripts/dashboard.js on lines 1353..1360
                                    assets/admin/pages/scripts/dashboard.js on lines 1362..1369
                                    assets/admin/pages/scripts/widgets.js on lines 24..31
                                    assets/admin/pages/scripts/widgets.js on lines 32..39
                                    assets/admin/pages/scripts/widgets.js on lines 40..47
                                    assets/admin/pages/scripts/widgets.js on lines 48..55

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

                                    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

                                                    }, {
                                                        title: 'Birthday',
                                                        start: new Date(y, m, d + 1, 19, 0),
                                                        end: new Date(y, m, d + 1, 22, 30),
                                                        backgroundColor: App.getBrandColor('purple'),
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 1 hr to fix
                                    assets/admin/scripts/calendar.js on lines 155..161

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

                                    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

                                                    $('#dashboard-report-range span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
                                    Severity: Minor
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 55 mins to fix
                                    assets/admin/pages/scripts/components-date-time-pickers.js on lines 148..148

                                    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

                                                    }, {
                                                        title: 'Lunch',
                                                        start: new Date(y, m, d, 14, 0),
                                                        end: new Date(y, m, d, 14, 0),
                                                        backgroundColor: App.getBrandColor('grey'),
                                    Severity: Minor
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 50 mins to fix
                                    assets/admin/scripts/calendar.js on lines 149..155

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

                                    if (App.isAngularJsApp() === false) {
                                        jQuery(document).ready(function() {
                                            Dashboard.init(); // init metronic core componets
                                        });
                                    }
                                    Severity: Major
                                    Found in assets/admin/pages/scripts/dashboard.js and 10 other locations - About 45 mins to fix
                                    assets/admin/layouts/global/scripts/quick-sidebar.js on lines 166..170
                                    assets/admin/layouts/layout/scripts/demo.js on lines 288..292
                                    assets/admin/layouts/layout/scripts/layout.js on lines 675..679
                                    assets/admin/layouts/layout2/scripts/demo.js on lines 284..288
                                    assets/admin/layouts/layout2/scripts/layout.js on lines 638..642
                                    assets/admin/layouts/layout3/scripts/layout.js on lines 292..296
                                    assets/admin/layouts/layout4/scripts/demo.js on lines 279..283
                                    assets/admin/layouts/layout4/scripts/layout.js on lines 580..584
                                    assets/admin/pages/scripts/components-form-tools.js on lines 198..202
                                    assets/admin/pages/scripts/form-input-mask.js on lines 62..66

                                    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

                                                    }, {
                                                        title: 'Long Event',
                                                        start: new Date(y, m, d - 5),
                                                        end: new Date(y, m, d - 2),
                                                        backgroundColor: App.getBrandColor('blue')
                                    Severity: Minor
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 45 mins to fix
                                    assets/admin/scripts/calendar.js on lines 130..135

                                    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

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

                                                    }, {
                                                        title: 'Click for Google',
                                                        start: new Date(y, m, 28),
                                                        end: new Date(y, m, 29),
                                                        backgroundColor: App.getBrandColor('yellow'),
                                    Severity: Minor
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 35 mins to fix
                                    assets/admin/scripts/calendar.js on lines 161..167

                                    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

                                                    $('<div id="tooltip" class="chart-tooltip">' + yValue + '<\/div>').css({
                                                        position: 'absolute',
                                                        display: 'none',
                                                        top: y - 40,
                                                        left: x - 40,
                                    Severity: Minor
                                    Found in assets/admin/pages/scripts/dashboard.js and 1 other location - About 35 mins to fix
                                    assets/admin/pages/scripts/ecommerce-dashboard.js on lines 4..12

                                    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