kosmatov/sidekiq-benchmark

View on GitHub

Showing 50 of 50 total issues

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

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

      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

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

        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

          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

          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

                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

          Method registered has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def self.registered(app)
                  app.helpers Chartkick::Helper
          
                  app.get '/benchmarks/javascripts/chartkick.js' do
                    body = File.read File.join(JS_DIR, 'chartkick.js')
          Severity: Major
          Found in lib/sidekiq-benchmark/web.rb - About 2 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
              Severity
              Category
              Status
              Source
              Language