CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js

Summary

Maintainability
C
1 day
Test Coverage

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

module.exports = cdb.core.View.extend({
  className: 'ImportOptions',

  _TABS_PER_ROW: 5,
  _DEFAULT_IMPORT: 'file',

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

      _genPanes: function () {
        var self = this;
    
        // Create TabPane
        this.importPanes = new cdb.ui.common.TabPane({

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

        _moveNextTabs: function () {
          var page = this.model.get('page');
          var maxPages = this.model.get('maxPages');
      
          if (page < maxPages) {
      lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 153..160

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

      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

        _movePrevTabs: function () {
          var page = this.model.get('page');
          if (page > 1) {
            this.model.set('page', page - 1);
          }
      lib/assets/javascripts/cartodb/common/dialogs/pecan/pecan_dialog_view.js on lines 162..167

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 60.

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

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

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

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

      Refactorings

      Further Reading

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

        _checkGDriveImport: function (imp, v) {
          if (!cdb.config.get('oauth_gdrive')) {
            v._setFailedTab('gdrive', 'key');
            return false;
          }
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 194..200
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 202..208
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 210..216

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

        _checkBigQueryImport: function (imp, v) {
          if (!cdb.config.get('oauth_bigquery')) {
            v._setFailedTab('bigquery', 'key');
            return false;
          }
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 186..192
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 202..208
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 210..216

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

        _checkDropboxImport: function (imp, v) {
          if (!cdb.config.get('oauth_dropbox')) {
            v._setFailedTab('dropbox', 'key');
            return false;
          }
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 186..192
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 194..200
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 210..216

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

        _checkBoxImport: function (imp, v) {
          if (!cdb.config.get('oauth_box')) {
            v._setFailedTab('box', 'key');
            return false;
          }
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 186..192
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 194..200
      lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports_view.js on lines 202..208

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

        clean: function () {
          this._destroyBinds();
          cdb.core.View.prototype.clean.call(this);
        }
      lib/assets/javascripts/cartodb/common/scroll/scroll-view.js on lines 84..87
      lib/assets/javascripts/cartodb/old_common/tipsy_tooltip.js on lines 53..56
      lib/assets/javascripts/cartodb/table/header/header_sync_info.js on lines 216..219
      lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 198..201
      lib/assets/javascripts/cartodb/table/menu_modules/infowindow/infowindow_tab.js on lines 275..278

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status