Vizzuality/gfw-climate

View on GitHub
app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js

Summary

Maintainability
F
1 wk
Test Coverage

File InsightsGladAlertsChartView.js has 798 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define(
  [
    'backbone',
    'handlebars',
    'underscore',

    Function _setUpGraph has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          _setUpGraph: function() {
            var el = this.el;
            var margin = this.defaults.margin;
            var isDesforestation =
              this.filter === this.defaults.desforestationFilter;

      Function _parseData has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            _parseData: function(data) {
              var range = _.range(WEEKS_YEAR);
              this.chartData = data;
              this.dataColumns = this.defaults.chartConfig[this.filter].dataColumns;
              this.dataDomain = this.defaults.chartConfig[this.filter].domain;

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

              _drawAxis: function() {
                var _this = this;
        
                // X Axis
                var xAxis = this.svg

          Function _drawSemiDashedLine has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                _drawSemiDashedLine: function() {
                  var _this = this;
                  var allYData = _.pluck(this.chartData, this.dataColumns.semiDashed.y);
                  var allXData = _.pluck(this.chartData, this.dataColumns.semiDashed.x);
                  var label = '2001 - 2014 Average:';

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

                  _setAxisScale: function() {
                    var _this = this;
                    var xTickFormat = d3.time.format(_this.defaults.dateFormat);
                    var yTickFormat = function(d) {
                      return d > 999 ? (d / 1000).toFixed(1) + 'k' : d;

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

                    _getDomain: function() {
                      var _this = this;
                      var xValues = [];
                      var x2Values = [];
                      var yValues = [];

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

                      _drawDashedLine: function() {
                        var _this = this;
                        var allYData = _.pluck(this.chartData, this.dataColumns.dashed.y);
                        var allXData = _.pluck(this.chartData, this.dataColumns.dashed.x);
                
                

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

                        _drawDots: function() {
                          var _this = this;
                          var dotsGroup = this.svg
                            .append('g')
                            .attr('class', 'dots-group')

                    Function _drawHandle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          _drawHandle: function() {
                            this.handleContainer = this.svg.append('g');
                    
                            this.handle = this.handleContainer
                              .append('rect')

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

                            _setCurrentTooltip: function(value) {
                              var currentStep = value || this.currentStep;
                              var current = d3.select('svg .dot-' + currentStep);
                      
                              d3.selectAll('svg .dot').classed('hovered', false);

                        Function _drawBrush has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              _drawBrush: function() {
                                this.brush = d3.svg
                                  .brush()
                                  .x(this.x2)
                                  .extent([0, 0])

                          Function _onBrushEnd has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                _onBrushEnd: function() {
                                  if (!d3.event.sourceEvent) return;
                                  var domain = this._getDomain();
                                  var xDomain = domain.x2;
                                  var element = this.el.querySelector('svg .handles');

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

                                    var line = d3.svg
                                      .line()
                                      .x(function(d) {
                                        return _this.x2(d[_this.dataColumns.semiDashed.x]);
                                      })
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 548..556

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

                            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 line = d3.svg
                                      .line()
                                      .x(function(d) {
                                        return _this.x2(d[_this.dataColumns.dashed.x]);
                                      })
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 592..600

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

                            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

                                      carbon_emissions: {
                                        domain: {
                                          x: 'date',
                                          x2: 'week',
                                          y: ['cumulative_emissions', 'carbon_average', 'carbon_target'],
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 75..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 111.

                            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

                                      deforestation: {
                                        domain: {
                                          x: 'date',
                                          x2: 'week',
                                          y: [
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 48..74

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

                            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

                                  _drawGraph: function() {
                                    this._drawHandle();
                                    this._drawSemiDashedLine();
                                    this._drawDashedLine();
                                    this._drawSolidLine();
                            app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 284..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 102.

                            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 dashLineLabel = dashedLine
                                      .append('text')
                                      .attr('x', this.x2(allXData[allXData.length - 1]))
                                      .attr('y', this.y(_.max(allYData)))
                                      .attr('class', 'line-label')
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 563..569

                            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

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

                                    var dashLineLabel = dashedLine
                                      .append('text')
                                      .attr('x', this.x2(allXData[allXData.length - 1]))
                                      .attr('y', this.y(_.max(allYData)))
                                      .attr('class', 'line-label')
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 607..613

                            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

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

                                    var svg = d3
                                      .select(el)
                                      .append('svg')
                                      .attr('width', this.cWidth + margin.left + margin.right + 'px')
                                      .attr('height', this.cHeight + margin.top + margin.bottom + 'px');
                            app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 203..207
                            app/assets/javascripts/countries/views/report/PieChartView.js on lines 149..153
                            app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 157..161
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 241..245

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

                            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 yAxis = this.svg
                                      .append('g')
                                      .attr('class', 'y axis')
                                      .attr(
                                        'transform',
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 354..364

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

                            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.yAxis = d3.svg
                                      .axis()
                                      .scale(this.y)
                                      .orient('left')
                                      .innerTickSize(0)
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 286..293

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

                            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 xAxis = this.svg
                                      .append('g')
                                      .attr('class', 'x axis')
                                      .attr('transform', 'translate(0,' + this.cHeight + ')')
                                      .call(this.xAxis);
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 336..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 63.

                            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.xAxis = d3.svg
                                      .axis()
                                      .scale(this.x)
                                      .orient('bottom')
                                      .innerTickSize(-this.cHeight)
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 276..282

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

                            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

                                  _showTooltip: function() {
                                    this.tooltip.classList.add('-visible');
                            
                                    d3.select('.' + this.defaults.chartClass).classed('hovering', true);
                                  },
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 963..967

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

                            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

                                  _hideTooltip: function() {
                                    this.tooltip.classList.remove('-visible');
                            
                                    d3.select('.' + this.defaults.chartClass).classed('hovering', false);
                                  },
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 969..973

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

                            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

                                  render: function() {
                                    this._setUpGraph();
                                    this._setAxisScale();
                                    this._setDomain();
                                    this._drawAxis();
                            app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 123..129
                            app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 105..111
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 157..163

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

                            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 dashedLine = this.svg
                                      .append('g')
                                      .attr('class', 'line-semidashed-group')
                                      .attr(
                                        'transform',
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 499..505
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 540..546
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 623..629

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

                            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 solidLineGroup = this.svg
                                      .append('g')
                                      .attr('class', 'line-solid-group')
                                      .attr(
                                        'transform',
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 499..505
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 540..546
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 584..590

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

                            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 dotsGroup = this.svg
                                      .append('g')
                                      .attr('class', 'dots-group')
                                      .attr(
                                        'transform',
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 540..546
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 584..590
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 623..629

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

                            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 dashedLine = this.svg
                                      .append('g')
                                      .attr('class', 'line-dashed-group')
                                      .attr(
                                        'transform',
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 499..505
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 584..590
                            app/assets/javascripts/insights/views/glad-alerts/InsightsGladAlertsChartView.js on lines 623..629

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

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

                                    this.svg = svg
                                      .append('g')
                                      .attr(
                                        'transform',
                                        'translate(' + margin.left + ',' + margin.top + ')'
                            app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 209..214
                            app/assets/javascripts/countries/views/report/ProvincesTopChartView.js on lines 163..168
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 247..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 52.

                            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

                                    xAxis
                                      .selectAll('line')
                                      .attr('x1', _this.defaults.paddingXAxisLabels)
                                      .attr('x2', _this.defaults.paddingXAxisLabels);
                            app/assets/javascripts/countries/views/report/SummaryChartView.js on lines 348..351

                            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