kosmatov/sidekiq-benchmark

View on GitHub
web/assets/javascripts/chartkick.js

Summary

Maintainability
F
2 wks
Test Coverage

File chartkick.js has 2018 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Chartkick.js
 * Create beautiful charts with one line of JavaScript
 * https://github.com/ankane/chartkick.js
 * v3.2.1
Severity: Major
Found in web/assets/javascripts/chartkick.js - About 5 days to fix

    Function createDataTable has 206 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var createDataTable = function (chart, options, chartType, library) {
        var datasets = [];
        var labels = [];
    
        var colors = chart.options.colors || defaultColors;
    Severity: Major
    Found in web/assets/javascripts/chartkick.js - About 1 day to fix

      Function setFormatOptions has 90 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var setFormatOptions = function(chart, options, chartType) {
          var formatOptions = {
            prefix: chart.options.prefix,
            suffix: chart.options.suffix,
            thousands: chart.options.thousands,
      Severity: Major
      Found in web/assets/javascripts/chartkick.js - About 3 hrs to fix

        Function formatValue has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function formatValue(pre, value, options, axis) {
            pre = pre || "";
            if (options.prefix) {
              if (value < 0) {
                value = value * -1;
        Severity: Major
        Found in web/assets/javascripts/chartkick.js - About 3 hrs to fix

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

            defaultExport$1.prototype.renderLineChart = function renderLineChart (chart, chartType) {
              chartType = chartType || "spline";
              var chartOptions = {};
              if (chartType === "areaspline") {
                chartOptions = {
          Severity: Minor
          Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

            Function createDataTable has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              defaultExport$2.prototype.createDataTable = function createDataTable (series, columnType) {
                var i, j, s, d, key, rows = [], sortedLabels = [];
                for (i = 0; i < series.length; i++) {
                  s = series[i];
                  series[i].name = series[i].name || "Value";
            Severity: Minor
            Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

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

                function addDownloadButton(chart) {
                  var element = chart.element;
                  var link = document.createElement("a");
              
                  var download = chart.options.download;
              Severity: Minor
              Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

                Function renderColumnChart has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  defaultExport$1.prototype.renderColumnChart = function renderColumnChart (chart, chartType) {
                    chartType = chartType || "column";
                    var series = chart.data;
                    var options = jsOptions$1(chart, chart.options), i, j, s, d, rows = [], categories = [];
                    options.chart.type = chartType;
                Severity: Minor
                Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

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

                    function jsOptionsFunc(defaultOptions, hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle) {
                      return function (chart, opts, chartOptions) {
                        var series = chart.data;
                        var options = merge({}, defaultOptions);
                        options = merge(options, chartOptions || {});
                  Severity: Minor
                  Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

                    Function renderPieChart has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      defaultExport.prototype.renderPieChart = function renderPieChart (chart) {
                        var options = merge({}, baseOptions);
                        if (chart.options.donut) {
                          options.cutoutPercentage = 50;
                        }
                    Severity: Minor
                    Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

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

                        defaultExport$2.prototype.renderPieChart = function renderPieChart (chart) {
                            var this$1 = this;
                      
                          this.waitForLoaded(chart, function () {
                            var chartOptions = {
                      Severity: Minor
                      Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

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

                          function parseISO8601(input) {
                            var day, hour, matches, milliseconds, minutes, month, offset, result, seconds, type, year;
                            type = Object.prototype.toString.call(input);
                            if (type === "[object Date]") {
                              return input;
                        Severity: Minor
                        Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if (chart.xtype === "datetime") {
                                    value = new Date(toFloat(i));
                                    // TODO make this efficient
                                    day = day && isDay(value);
                                    if (!dayOfWeek) {
                          Severity: Major
                          Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

                            Function jsOptionsFunc has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              function jsOptionsFunc(defaultOptions, hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle) {
                            Severity: Major
                            Found in web/assets/javascripts/chartkick.js - About 1 hr to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (isArray(dataLabel)) {
                                          // show value on first line of multiline label
                                          // need to clone because we are changing the value
                                          dataLabel = dataLabel.slice();
                                          dataLabel[0] += value;
                              Severity: Major
                              Found in web/assets/javascripts/chartkick.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          if (label) {
                                            label += ': ';
                                          }
                                Severity: Major
                                Found in web/assets/javascripts/chartkick.js - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                        if ((options.xmin || options.xmax) && (!options.xmin || isDate(options.xmin)) && (!options.xmax || isDate(options.xmax))) {
                                          return "datetime";
                                        } else {
                                          return "number";
                                        }
                                  Severity: Major
                                  Found in web/assets/javascripts/chartkick.js - About 40 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          return "string";
                                    Severity: Major
                                    Found in web/assets/javascripts/chartkick.js - About 30 mins to fix

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

                                        var ColumnChart = /*@__PURE__*/(function (Chart) {
                                          function ColumnChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 6 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2291..2309

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

                                      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 BarChart = /*@__PURE__*/(function (Chart) {
                                          function BarChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 6 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2271..2289

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

                                      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 ScatterChart = /*@__PURE__*/(function (Chart) {
                                          function ScatterChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 5 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2371..2389

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

                                      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 BubbleChart = /*@__PURE__*/(function (Chart) {
                                          function BubbleChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 5 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2351..2369

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

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

                                        var AreaChart = /*@__PURE__*/(function (Chart) {
                                          function AreaChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 3 other locations - About 5 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2231..2249
                                      web/assets/javascripts/chartkick.js on lines 2251..2269
                                      web/assets/javascripts/chartkick.js on lines 2331..2349

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

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

                                        var PieChart = /*@__PURE__*/(function (Chart) {
                                          function PieChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 3 other locations - About 5 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2231..2249
                                      web/assets/javascripts/chartkick.js on lines 2311..2329
                                      web/assets/javascripts/chartkick.js on lines 2331..2349

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

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

                                        var LineChart = /*@__PURE__*/(function (Chart) {
                                          function LineChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 3 other locations - About 5 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2251..2269
                                      web/assets/javascripts/chartkick.js on lines 2311..2329
                                      web/assets/javascripts/chartkick.js on lines 2331..2349

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

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

                                        var GeoChart = /*@__PURE__*/(function (Chart) {
                                          function GeoChart () {
                                            Chart.apply(this, arguments);
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 3 other locations - About 5 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 2231..2249
                                      web/assets/javascripts/chartkick.js on lines 2251..2269
                                      web/assets/javascripts/chartkick.js on lines 2311..2329

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                        function negativeValues(series) {
                                          var i, j, data;
                                          for (i = 0; i < series.length; i++) {
                                            data = series[i].data;
                                            for (j = 0; j < data.length; j++) {
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 3 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 348..359

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                        function allZeros(data) {
                                          var i, j, d;
                                          for (i = 0; i < data.length; i++) {
                                            d = data[i].data;
                                            for (j = 0; j < d.length; j++) {
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 3 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 94..105

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

                                      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 formatOptions = {
                                            prefix: chart.options.prefix,
                                            suffix: chart.options.suffix,
                                            thousands: chart.options.thousands,
                                            decimal: chart.options.decimal,
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 3 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 1077..1085

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

                                      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 formatOptions = {
                                            prefix: chart.options.prefix,
                                            suffix: chart.options.suffix,
                                            thousands: chart.options.thousands,
                                            decimal: chart.options.decimal,
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 3 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 493..501

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                            for (var i$1 = 0; i$1 < series.length; i$1++) {
                                              var s$1 = series[i$1];
                                              for (var j$1 = 0; j$1 < s$1.data.length; j$1++) {
                                                if (s$1.data[j$1][2] > max) {
                                                  max = s$1.data[j$1][2];
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 2 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 511..518

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 88.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                            for (var i = 0; i < series.length; i++) {
                                              var s = series[i];
                                              for (var j = 0; j < s.data.length; j++) {
                                                if (s.data[j][1] > max) {
                                                  max = s.data[j][1];
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 2 hrs to fix
                                      web/assets/javascripts/chartkick.js on lines 621..628

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 88.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                        var setYtitle = function (options, title) {
                                          options.scales.yAxes[0].scaleLabel.display = true;
                                          options.scales.yAxes[0].scaleLabel.labelString = title;
                                        };
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 1 hr to fix
                                      web/assets/javascripts/chartkick.js on lines 451..454

                                      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

                                        var setXtitle = function (options, title) {
                                          options.scales.xAxes[0].scaleLabel.display = true;
                                          options.scales.xAxes[0].scaleLabel.labelString = title;
                                        };
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 1 hr to fix
                                      web/assets/javascripts/chartkick.js on lines 456..459

                                      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

                                        var setBarMin = function (options, min) {
                                          if (min !== null) {
                                            options.scales.xAxes[0].ticks.min = toFloat(min);
                                          }
                                        };
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 1 hr to fix
                                      web/assets/javascripts/chartkick.js on lines 426..430

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 56.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                        var setMin = function (options, min) {
                                          if (min !== null) {
                                            options.scales.yAxes[0].ticks.min = toFloat(min);
                                          }
                                        };
                                      Severity: Major
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 1 hr to fix
                                      web/assets/javascripts/chartkick.js on lines 436..440

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 56.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                            if (notnull(xmin)) {
                                              options.scales.xAxes[0][ticksKey].min = toDate(xmin).getTime();
                                            }
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 755..757

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

                                      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 (notnull(xmax)) {
                                              options.scales.xAxes[0][ticksKey].max = toDate(xmax).getTime();
                                            }
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 752..754

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

                                      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

                                        defaultExport$1.prototype.destroy = function destroy (chart) {
                                          if (chart.chart) {
                                            chart.chart.destroy();
                                          }
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 2 other locations - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 961..965
                                      web/assets/javascripts/chartkick.js on lines 1558..1562

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

                                      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 setYtitle$2 = function (options, title) {
                                          options.vAxis.title = title;
                                          options.vAxis.titleTextStyle.italic = false;
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 1355..1358

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

                                      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 setXtitle$2 = function (options, title) {
                                          options.hAxis.title = title;
                                          options.hAxis.titleTextStyle.italic = false;
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 1360..1363

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

                                      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

                                        defaultExport$2.prototype.destroy = function destroy (chart) {
                                          if (chart.chart) {
                                            chart.chart.clearChart();
                                          }
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 2 other locations - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 961..965
                                      web/assets/javascripts/chartkick.js on lines 1249..1253

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

                                      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

                                        defaultExport.prototype.destroy = function destroy (chart) {
                                          if (chart.chart) {
                                            chart.chart.destroy();
                                          }
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 2 other locations - About 40 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 1249..1253
                                      web/assets/javascripts/chartkick.js on lines 1558..1562

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

                                      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 (chart.options.code) {
                                            window.console.log("new Chart(ctx, " + JSON.stringify(chartOptions) + ");");
                                          }
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 35 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 1261..1263

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 46.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                          if (chart.options.code) {
                                            window.console.log("new Highcharts.Chart(" + JSON.stringify(options) + ");");
                                          }
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 35 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 976..978

                                      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

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

                                          for (i = 0; i < series.length; i++) {
                                            data.addColumn("number", series[i].name);
                                          }
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 30 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 1524..1526

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 45.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                            for (i = 0; i < series.length; i++) {
                                              data.addColumn("number", series[i].name);
                                            }
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 30 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 1671..1673

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 45.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                        var setMax = function (options, max) {
                                          options.scales.yAxes[0].ticks.max = toFloat(max);
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 30 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 442..444

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 45.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                        var setBarMax = function (options, max) {
                                          options.scales.xAxes[0].ticks.max = toFloat(max);
                                        };
                                      Severity: Minor
                                      Found in web/assets/javascripts/chartkick.js and 1 other location - About 30 mins to fix
                                      web/assets/javascripts/chartkick.js on lines 432..434

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 45.

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

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

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

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

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status