Vizzuality/gfw-climate

View on GitHub
app/assets/javascripts/widgets/indicators/line/LineChart.js

Summary

Maintainability
F
6 days
Test Coverage

File LineChart.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define(
  [
    'jquery',
    'd3',
    'underscore',
Severity: Minor
Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 3 hrs to fix

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

        LineChart.prototype._drawTooltip = function() {
          var self = this;
    
          // Tooltip
          this.tooltip = d3
    Severity: Minor
    Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

      Function _createScales has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          LineChart.prototype._createScales = function() {
            var self = this;
            this.xKey = this.options.keys.x;
            this.yKey = this.options.keys.y;
      
      
      Severity: Minor
      Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

        Function setTooltip has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            LineChart.prototype.setTooltip = function(x0, is_reflect) {
              var self = this;
              var data = this.data;
              var info = [];
              var formatDate = d3.time.format('%Y');
        Severity: Minor
        Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

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

              LineChart.prototype._drawAxes = function(group) {
                var self = this;
                var tickFormatY = this.unit != 'percentage' ? 's' : '.2f';
                this.xAxis = d3.svg
                  .axis()
          Severity: Minor
          Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

            Function _drawAverages has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                LineChart.prototype._drawAverages = function() {
                  var self = this;
            
                  var txtaverage;
                  var average =
            Severity: Minor
            Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

              Function LineChart has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var LineChart = function(options) {
                    this.svg;
                    this.options = options;
                    this.parent = options.parent;
                    this.data = options.data;
              Severity: Minor
              Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

                Function setListeners has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    LineChart.prototype.setListeners = function() {
                      var formatDate = d3.time.format('%Y');
                      var bisectDate = d3.bisector(function(d) {
                        return d.year;
                      }).left;
                Severity: Minor
                Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

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

                        this.svg
                          .on('mouseenter', function() {
                            self.positioner.style('visibility', 'visible');
                            self.tooltip.style('visibility', 'visible');
                          })
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 1 day to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 254..273

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

                  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

                          self.tooltip
                            .classed('is-reflect', is_reflect)
                            // .html('<span class="date">' + year + '</span>' + value )
                            .html(this.templateTooltip({ year: info[0].year, tootip_info: info }))
                            .style('left', $(self.positioner[0]).offset().left + 'px')
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 311..317

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

                  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

                        mps.subscribe(
                          'LineChart/mouseout' + this.options.slug + this.options.id,
                          function() {
                            if (!!self.svg) {
                              self.positioner
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 330..342

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

                  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

                        this.line = d3.svg
                          .line()
                          .interpolate('linear')
                          .x(function(d) {
                            return self.x(d[self.xKey]);
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 93..101

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 96.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      LineChart.prototype._createEl = function() {
                        this.svg = d3
                          .select(this.options.el)
                          .append('svg')
                          .attr('class', 'lineChart')
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 2 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 62..69
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 64..71

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

                  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 format = self.unit != 'percentage' ? '.3s' : '.2f',
                            xyear = self.x(d.year),
                            year = formatDate(d.year),
                            value = d3.format(format)(d.value) + ' ' + self.unitname;
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 291..294

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

                  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

                      LineChart.prototype._createDefs = function() {
                        this.svg
                          .append('defs')
                          .append('clipPath')
                          .attr('id', 'clip')
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 2 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 104..112
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 139..147

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

                  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

                        this.positioner = this.svg
                          .append('svg:line')
                          .attr('x1', 0)
                          .attr('y1', 0)
                          .attr('x2', 0)
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 245..252

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 81.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        (this.width = this.parentWidth - this.sizing.left - this.sizing.right),
                          (this.height =
                            this.parentHeight - this.sizing.top - this.sizing.bottom);
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 2 hrs to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 32..34
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 32..34

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 78.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        mps.subscribe(
                          'LineChart/mousemove' + this.options.slug + this.options.id,
                          function(x0) {
                            if (!!self.svg) {
                              self.setTooltip(x0, true);
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 343..350
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 333..340

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 67.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        this.y = d3.scale
                          .linear()
                          .range([
                            this.height - this.options.innerPadding.bottom,
                            this.options.innerPadding.top
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 85..90

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

                        this.x = d3.time
                          .scale()
                          .range([
                            this.options.innerPadding.left,
                            this.width - this.options.innerPadding.right
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 76..81
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 111..116

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

                  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

                          self.positioner
                            .style('visibility', 'visible')
                            .attr('x1', xyear + self.sizing.left)
                            .attr('x2', xyear + self.sizing.left);
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 296..299

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

                  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

                        if (!!this.parentWidth && !!this.parentHeight) {
                          this._createEl();
                          this._createDefs();
                          this._createScales();
                        }
                  Severity: Major
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 35..39

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

                  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

                        this.svg
                          .selectAll('circle.dot')
                          .data(this.data)
                          .enter()
                          .append('circle')
                  Severity: Minor
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 1 other location - About 55 mins to fix
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 192..200

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 54.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        $(window).on(
                          'resize.namespace' + this.namespace,
                          _.debounce(this.resize.bind(this), 100)
                        );
                  Severity: Minor
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 35 mins to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 43..46
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 45..48

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        this.tooltip = d3
                          .select('body')
                          .append('div')
                          .attr('class', 'linegraph-tooltip')
                          .style('visibility', 'hidden');
                  Severity: Minor
                  Found in app/assets/javascripts/widgets/indicators/line/LineChart.js and 2 other locations - About 35 mins to fix
                  app/assets/javascripts/widgets/indicators/multiline/MultiLineChart.js on lines 239..243
                  app/assets/javascripts/widgets/indicators/stacked/StackedChart.js on lines 263..267

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status