CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/deep-insights/widgets/histogram/chart.js

Summary

Maintainability
F
2 wks
Test Coverage

File chart.js has 1400 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var $ = require('jquery');
var _ = require('underscore');
var d3 = require('d3');
var d3Interpolate = require('d3-interpolate');
var CoreModel = require('backbone/core-model');
Severity: Major
Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 3 days to fix

    exports has 123 functions (exceeds 20 allowed). Consider refactoring.
    Open

    module.exports = CoreView.extend({
      options: {
        // render the chart once the width is set as default, provide false value for this prop to disable this behavior
        // e.g. for "mini" histogram behavior
        showOnWidthChange: true,
    Severity: Major
    Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 2 days to fix

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

        _generateFillGradients: function () {
          if (!this._widgetModel || !this._widgetModel.isAutoStyleEnabled()) {
            return false;
          }
      
      
      Severity: Major
      Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 3 hrs to fix

        Function _getFillColor has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          _getFillColor: function (d, i) {
            if (this._widgetModel) {
              if (this._widgetModel.isAutoStyle()) {
                if (this._hasFilterApplied()) {
                  if (!this._isBarChartWithinFilter(i)) {
        Severity: Minor
        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function _updateAxisTip has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _updateAxisTip: function (className) {
            var leftTip = 'left_axis_tip';
            var rightTip = 'right_axis_tip';
            var attr = className + '_axis_tip';
            var isRight = className === 'right';
        Severity: Major
        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 2 hrs to fix

          Function _generateBars has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _generateBars: function () {
              var self = this;
              var data = this.model.get('data');
          
              this._calcBarWidth();
          Severity: Major
          Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 2 hrs to fix

            Function _updateChart has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _updateChart: function () {
                var self = this;
                var data = this.model.get('data');
            
                var bars = this.chart.selectAll('.CDB-Chart-bar')
            Severity: Major
            Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 2 hrs to fix

              Function _calculateDataDomain has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                _calculateDataDomain: function () {
                  var data = _.clone(this.model.get('data'));
                  var minBin;
                  var maxBin;
                  var minValue;
              Severity: Minor
              Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                _generateShadowBars: function () {
                  var data = this._getData();
              
                  if (!data || !data.length || !this.model.get('show_shadow_bars') || this.model.get('normalized')) {
                    this._removeShadowBars();
              Severity: Minor
              Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                Function _resizeToParentElement has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  _resizeToParentElement: function () {
                    if (this.$el.parent()) {
                      // Hide this view temporarily to get actual size of the parent container
                      var wasHidden = this.isHidden();
                
                
                Severity: Minor
                Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function _calculateDataDomain has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _calculateDataDomain: function () {
                    var data = _.clone(this.model.get('data'));
                    var minBin;
                    var maxBin;
                    var minValue;
                Severity: Minor
                Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

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

                    _setupBindings: function () {
                      this.listenTo(this.model, 'change:data', this._onChangeData);
                      this.listenTo(this.model, 'change:display', this._onChangeDisplay);
                      this.listenTo(this.model, 'change:dragging', this._onChangeDragging);
                      this.listenTo(this.model, 'change:height', this._onChangeHeight);
                  Severity: Minor
                  Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

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

                      _onMouseMove: function () {
                        var x = d3.event.offsetX - this.model.get('margin').left;
                    
                        var barIndex = Math.floor(x / this.barWidth);
                        var data = this.model.get('data');
                    Severity: Minor
                    Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

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

                        _onBrushEnd: function () {
                          var data = this.model.get('data');
                          var brush = this.brush;
                          var loPosition, hiPosition;
                      
                      
                      Severity: Minor
                      Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                        Function _updateAxisTip has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _updateAxisTip: function (className) {
                            var leftTip = 'left_axis_tip';
                            var rightTip = 'right_axis_tip';
                            var attr = className + '_axis_tip';
                            var isRight = className === 'right';
                        Severity: Minor
                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function _onBrushEnd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _onBrushEnd: function () {
                            var data = this.model.get('data');
                            var brush = this.brush;
                            var loPosition, hiPosition;
                        
                        
                        Severity: Minor
                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function _onMouseMove has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _onMouseMove: function () {
                            var x = d3.event.offsetX - this.model.get('margin').left;
                        
                            var barIndex = Math.floor(x / this.barWidth);
                            var data = this.model.get('data');
                        Severity: Minor
                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                          _generateHandle: function (className) {
                            var height = this._isTabletViewport() && this._isTimeSeries() ? this.chartHeight() * 2 : this.chartHeight();
                            var opts = { width: this.options.handleWidth, height: height, radius: this.options.handleRadius };
                        
                            var handle = this.chart.select('.CDB-Chart-handles')
                        Severity: Minor
                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

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

                            _generateAxisTip: function (className) {
                              var handle = this.chart.select('.CDB-Chart-handle.CDB-Chart-handle-' + className);
                          
                              var yPos = className === 'right' && !(this._isMobileViewport() && this._isTimeSeries())
                                ? this.chartHeight() + (TRIANGLE_HEIGHT * TRIANGLE_RIGHT_FACTOR) : -(TRIANGLE_HEIGHT + TIP_RECT_HEIGHT + TOOLTIP_MARGIN);
                          Severity: Minor
                          Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

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

                              initialize: function () {
                                this._originalData = this.options.originalData;
                            
                                if (!_.isNumber(this.options.height)) throw new Error('height is required');
                                if (!this.options.dataviewModel) throw new Error('dataviewModel is required');
                            Severity: Minor
                            Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

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

                                _generateNumericAxis: function () {
                                  var self = this;
                                  var adjustTextAnchor = this._generateAdjustAnchorMethod(this.verticalRange);
                              
                                  var axis = this.chart.append('g')
                              Severity: Minor
                              Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 1 hr to fix

                                Function trianglePath has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                var trianglePath = function (x1, y1, x2, y2, x3, y3, yFactor) {
                                Severity: Major
                                Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 50 mins to fix

                                  Function _getValueFromBinIndex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    _getValueFromBinIndex: function (index) {
                                      if (!_.isNumber(index)) {
                                        return null;
                                      }
                                      var result = null;
                                  Severity: Minor
                                  Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 45 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function _updateTriangle has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    _updateTriangle: function (isRight, triangle, start, center, rectWidth) {
                                  Severity: Minor
                                  Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 35 mins to fix

                                    Function _generateHandle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      _generateHandle: function (className) {
                                        var height = this._isTabletViewport() && this._isTimeSeries() ? this.chartHeight() * 2 : this.chartHeight();
                                        var opts = { width: this.options.handleWidth, height: height, radius: this.options.handleRadius };
                                    
                                        var handle = this.chart.select('.CDB-Chart-handles')
                                    Severity: Minor
                                    Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 35 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Function _getMaxValueFromBinIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      _getMaxValueFromBinIndex: function (binIndex) {
                                        var result = null;
                                        var data = this.model.get('data');
                                        var dataBin = data[binIndex];
                                        if (dataBin) {
                                    Severity: Minor
                                    Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 35 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Avoid too many return statements within this function.
                                    Open

                                        return this.options.chartBarColor;
                                    Severity: Major
                                    Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return this._widgetModel.getWidgetColor() || this.options.chartBarColor;
                                      Severity: Major
                                      Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 30 mins to fix

                                        Function _calculateTimelySpacedDivisions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          _calculateTimelySpacedDivisions: function () {
                                            this._calcBarWidth();
                                            var divisions = Math.round(this.chartWidth() / this.options.divisionWidth);
                                            var bucketsPerDivision = Math.ceil(this.model.get('data').length / divisions);
                                            var range = [0];
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js - About 25 mins to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

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

                                            bars
                                              .attr('data-tooltip', function (d) {
                                                return self._tooltipFormatter(d.freq);
                                              })
                                              .transition()
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1504..1542

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

                                        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

                                            bars
                                              .attr('data-tooltip', function (d) {
                                                return self._tooltipFormatter(d.freq);
                                              })
                                              .transition()
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1596..1637

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

                                        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._linearGradientsHover
                                              .selectAll('stop')
                                              .data(d3.range(stopsNumber + 1))
                                              .enter()
                                              .append('stop')
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1411..1424

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

                                        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._linearGradients
                                              .selectAll('stop')
                                              .data(d3.range(stopsNumber + 1))
                                              .enter()
                                              .append('stop')
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1426..1439

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

                                        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.__scale__ = d3.scale.linear()
                                                  .range([self._getMinValueFromBinIndex(i), self._getMaxValueFromBinIndex(i)])
                                                  .domain([0, 1]);
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1383..1385

                                        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

                                                this.__scale__ = d3.scale.linear()
                                                  .range([ self._getMinValueFromBinIndex(i), self._getMaxValueFromBinIndex(i) ])
                                                  .domain([0, 1]);
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1401..1403

                                        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

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

                                          reset: function () {
                                            this._removeChartContent();
                                            this._setupDimensions();
                                            this._calcBarWidth();
                                            this._generateChartContent();
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 482..488
                                        lib/assets/javascripts/deep-insights/widgets/histogram/content-view.js on lines 100..106

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

                                          _removeChartContent: function () {
                                            this._removeBrush();
                                            this._removeHandles();
                                            this._removeBars();
                                            this._removeAxis();
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 435..441
                                        lib/assets/javascripts/deep-insights/widgets/histogram/content-view.js on lines 100..106

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

                                          _getLoBarIndex: function () {
                                            var extent = this.brush.extent();
                                            return Math.round(this.xScale(extent[0]) / this.barWidth);
                                          },
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 883..886

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          _getHiBarIndex: function () {
                                            var extent = this.brush.extent();
                                            return Math.round(this.xScale(extent[1]) / this.barWidth);
                                          },
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 878..881

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            axisTip.append('rect')
                                              .attr('class', 'CDB-Chart-axisTipRect CDB-Chart-axisTip-' + className)
                                              .attr('rx', '2')
                                              .attr('ry', '2')
                                              .attr('opacity', '1')
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 55 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1112..1117

                                        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

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

                                            axisTip.append('text')
                                              .attr('class', 'CDB-Text CDB-Size-small CDB-Chart-axisTipText CDB-Chart-axisTip-' + className)
                                              .attr('dy', '11')
                                              .attr('dx', '0')
                                              .attr('opacity', '1')
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 55 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1105..1110

                                        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

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

                                          _onChangeDisplay: function () {
                                            if (this.model.get('display')) {
                                              this._show();
                                            } else {
                                              this._hide();
                                        lib/assets/javascripts/cartodb/table/mapview.js on lines 1220..1226
                                        lib/assets/javascripts/deep-insights/widgets/dropdown/widget-dropdown-view.js on lines 100..106
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 749..755

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 53.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          _onChangeShowShadowBars: function () {
                                            if (this.model.get('show_shadow_bars')) {
                                              this._generateShadowBars();
                                            } else {
                                              this._removeShadowBars();
                                        lib/assets/javascripts/cartodb/table/mapview.js on lines 1220..1226
                                        lib/assets/javascripts/deep-insights/widgets/dropdown/widget-dropdown-view.js on lines 100..106
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 757..763

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 53.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            return d3.scale.linear().domain([0, this._getMaxData(data)]).range([this.chartHeight(), 0]);
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 40 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1658..1658

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 49.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            var yScale = d3.scale.linear().domain([0, this._getMaxData(data)]).range([this.chartHeight(), 0]);
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 40 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 647..647

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 49.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            var height = this._isTabletViewport() && this._isTimeSeries() ? this.chartHeight() * 2 : this.chartHeight();
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 40 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1125..1125

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 48.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            var height = this._isTabletViewport() && this._isTimeSeries() ? this.chartHeight() * 2 : this.chartHeight();
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 40 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 910..910

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 48.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          _removeLines: function () {
                                            this.chart.select('.CDB-Chart-lines').remove();
                                            this.chart.select('.CDB-Chart-line--bottom').remove();
                                          },
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
                                        lib/assets/javascripts/cartodb/table/menu_modules/filters.js on lines 394..397

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 47.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.chart.append('g')
                                              .attr('transform', 'translate(0, 0)')
                                              .attr('class', 'CDB-Chart-shadowBars')
                                              .selectAll('.CDB-Chart-shadowBar')
                                              .data(data)
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1575..1579

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 47.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            var bars = this.chart.append('g')
                                              .attr('transform', 'translate(0, 0)')
                                              .attr('class', 'CDB-Chart-bars')
                                              .selectAll('.CDB-Chart-bar')
                                              .data(data);
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1662..1666

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 47.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this._linearGradientsHover = defs
                                              .selectAll('.gradient-hover')
                                              .data(data)
                                              .enter()
                                              .append('linearGradient')
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1375..1387

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 46.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this._linearGradients = defs
                                              .selectAll('.gradient')
                                              .data(data)
                                              .enter()
                                              .append('linearGradient')
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 35 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1393..1405

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 46.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.chart
                                              .selectAll('.CDB-Chart-bar')
                                              .classed('is-highlighted', false)
                                              .attr('fill', this._getFillColor.bind(this));
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 30 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1046..1048

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 45.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.chart.selectAll('.CDB-Chart-bar')
                                              .classed('is-highlighted', false)
                                              .attr('fill', this._getFillColor.bind(this));
                                        Severity: Minor
                                        Found in lib/assets/javascripts/deep-insights/widgets/histogram/chart.js and 1 other location - About 30 mins to fix
                                        lib/assets/javascripts/deep-insights/widgets/histogram/chart.js on lines 1557..1560

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 45.

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

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

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

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

                                        Refactorings

                                        Further Reading

                                        There are no issues that match your filters.

                                        Category
                                        Status