CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js

Summary

Maintainability
F
4 days
Test Coverage

File data-view.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var _ = require('underscore');
var Backbone = require('backbone');
var CoreView = require('backbone/core-view');
var PanelWithOptionsView = require('builder/components/view-options/panel-with-options-view');
var ScrollView = require('builder/components/scroll/scroll-view');

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

    module.exports = DatasetBaseView.extend({
      initialize: function (opts) {
        checkAndBuildOpts(opts, REQUIRED_OPTS, this);
        this._nodeModel = opts.layerDefinitionModel.getAnalysisDefinitionNodeModel();
        this._querySchemaModel = this._nodeModel.querySchemaModel;

      Function _initViews has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _initViews: function () {
          var self = this;
      
          var infoboxSstates = [
            {

        Function _configPanes has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _configPanes: function () {
            var self = this;
            var tabPaneTabs = [{
              selected: !this._editorModel.get('edition'),
              createContentView: function () {

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

            initialize: function (opts) {
              checkAndBuildOpts(opts, REQUIRED_OPTS, this);
              this._nodeModel = opts.layerDefinitionModel.getAnalysisDefinitionNodeModel();
              this._querySchemaModel = this._nodeModel.querySchemaModel;
              this._queryGeometryModel = this._nodeModel.queryGeometryModel;

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

                var panelWithOptionsView = new PanelWithOptionsView({
                  className: 'Editor-content',
                  editorModel: self._editorModel,
                  infoboxModel: self._infoboxModel,
                  infoboxCollection: infoboxCollection,
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 121..142
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 251..272
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 197..218

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

            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

              _onChangeEdition: function () {
                this._infoboxState();
            
                var edition = this._editorModel.get('edition');
                var index = edition ? 1 : 0;
            lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 126..133
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 308..315
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 326..333

            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

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

                  {
                    state: 'readonly',
                    createContentView: function () {
                      return Infobox.createWithAction({
                        type: 'code',
            lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 84..97
            lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 388..401
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 90..103
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 103..116
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 207..220
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 220..233
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 233..246

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

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

                  }, {
                    state: 'layer-hidden',
                    createContentView: function () {
                      return Infobox.createWithAction({
                        type: 'alert',
            lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 84..97
            lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 366..379
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 90..103
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 103..116
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 207..220
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 220..233
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 233..246

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

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

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

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

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

            Refactorings

            Further Reading

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

                this._onboardingLauncher = new OnboardingLauncher({
                  view: OnboardingView,
                  onboardingNotification: this._onboardingNotification,
                  notificationKey: ONBOARDING_KEY,
                  onboardings: this._onboardings
            lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 49..57
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 84..92

            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

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

              _showHiddenLayer: function () {
                var savingOptions = {
                  shouldPreserveAutoStyle: true
                };
                this._layerDefinitionModel.toggleVisible();
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 355..361
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 225..231
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 278..284
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 218..224
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 467..473

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 57.

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

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

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

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

            Refactorings

            Further Reading

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

              render: function () {
                this._launchOnboarding();
                this.clearSubViews();
                this.$el.empty();
            
            
            lib/assets/javascripts/builder/components/form-components/editors/size/size-fixed-view.js on lines 5..11
            lib/assets/javascripts/builder/components/input-number/input-number-fixed-content-view.js on lines 5..11
            lib/assets/javascripts/builder/editor/style/style-form/style-properties-form/style-shape-properties-form-view.js on lines 27..33
            lib/assets/javascripts/builder/editor/widgets/widgets-form/widgets-form-fields-view.js on lines 42..48
            lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 61..69

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 57.

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

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

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

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

            Refactorings

            Further Reading

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

                  }, {
                    state: 'no-data',
                    createContentView: function () {
                      return Infobox.createInfo({
                        type: 'alert',
            lib/assets/javascripts/builder/editor/export-image-pane/export-image-pane.js on lines 135..144

            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

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

                MetricsTracker.track(MetricsTypes.APPLIED_SQL, {
                  node_id: this._nodeModel.get('id'),
                  sql: this._nodeModel.get('query')
                });
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 274..277

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

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

              _onTogglerChanged: function () {
                var checked = this._togglerModel.get('active');
                this._editorModel.set({ edition: checked });
              },
            lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
            lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
            lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 293..296
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..343

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

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

              _onChangeDisabled: function () {
                var disabled = this._editorModel.get('disabled');
                this._togglerModel.set({ disabled: disabled });
              },
            lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 135..138
            lib/assets/javascripts/builder/dataset/dataset-options/dataset-options-view.js on lines 140..143
            lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-view.js on lines 298..301
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 317..320
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 322..325
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 193..196
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 198..201
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 335..338
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 340..343

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

            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

                  createContentView: function () {
                    return new DataSQLView({
                      layerDefinitionModel: self._layerDefinitionModel,
                      querySchemaModel: self._querySchemaModel,
                      codemirrorModel: self._codemirrorModel,
            lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-content-view.js on lines 136..143

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

            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._querySchemaModel.bind('change:status', function () {
                  this._applyButtonStatusModel.set('loading', this._querySchemaModel.isFetching());
                }, this);
            lib/assets/javascripts/cartodb/table/menu_modules/wizards/category_wizard.js on lines 35..37

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 49.

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

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

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

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

            Refactorings

            Further Reading

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

                } else if (this._isLayerHidden()) {
                  this._infoboxModel.set({ state: 'layer-hidden' });
                  this._overlayModel.set({ visible: true });
                } else {
                  this._codemirrorModel.set({ readonly: false });
            lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 169..178
            lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-view.js on lines 172..178
            lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-base-view.js on lines 341..352
            lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legend-base-type-view.js on lines 329..340
            lib/assets/javascripts/builder/editor/style/style-view.js on lines 453..464

            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._columnsModel = new DataColumnsModel({}, {
                  layerDefinitionModel: this._layerDefinitionModel,
                  widgetDefinitionsCollection: this._widgetDefinitionsCollection,
                  tableStats: this._tableStats
                });
            lib/assets/javascripts/cartodb/common/dialogs/edit_vis_metadata/edit_vis_metadata_dialog_view.js on lines 32..36

            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