CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/cartodb/table/tableview.js

Summary

Maintainability
F
1 wk
Test Coverage

File tableview.js has 549 lines of code (exceeds 250 allowed). Consider refactoring.
Open


(function() {

    /**
     * table view shown in admin
Severity: Major
Found in lib/assets/javascripts/cartodb/table/tableview.js - About 1 day to fix

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

          _editCell: function(e, cell, x, y) {
            var self = this;
    
            // Clean and close previous cell editor
            this.closeEditor();
    Severity: Major
    Found in lib/assets/javascripts/cartodb/table/tableview.js - About 2 hrs to fix

      Function initPaginationAndScroll has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            initPaginationAndScroll: function() {
              var self = this;
              var topReached = false;
              var bottomReached = false;
      
      
      Severity: Minor
      Found in lib/assets/javascripts/cartodb/table/tableview.js - About 1 hr to fix

        Function headerView has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              headerView: function(column) {
                var self = this;
        
                if(column[1] !== 'header') {
                  var v = new cdb.admin.HeaderView({
        Severity: Minor
        Found in lib/assets/javascripts/cartodb/table/tableview.js - About 1 hr to fix

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

                  this.checkScrollTimer = setInterval(function() {
                    if(!self.$el.is(":visible") || self.model.data().isFetchingPage()) {
                      return;
                    }
                    var pos = $(this).scrollTop();
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/table/tableview.js - About 1 hr to fix

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

                  initializeBindings: function() {
                    var self = this;
            
                    _.bindAll(this, "render", "rowSaving", "addEmptyRow",
                      "_checkEmptyTable", "_forceScroll", "_scrollMagic",
            Severity: Minor
            Found in lib/assets/javascripts/cartodb/table/tableview.js - About 1 hr to fix

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

                    _highlightColumn: function() {
              
                      if (this.newColumnName) {
              
                        var $th = this.$("a[href='#" + this.newColumnName + "']").parents("th");
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 day to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 184..202

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

              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

                    _onSQLView: function() {
                      // bind each time we change dataSource because table unbind
                      // all the events from sqlView object each time useSQLView is called
                      this.$('.sqlview').remove();
              
              
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 6 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 263..275

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

              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

                    setActiveLayer: function(layerView) {
                      var recreate = !!this.tableView;
                      this.deactivated();
                      this.model = layerView.table;
                      this.layer = layerView.model;
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 3 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-tab/table-tab.js on lines 15..24

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

              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

                    initialize: function() {
                      this.user = this.options.user;
                      this.sqlView = this.options.sqlView;
                      this.geocoder = this.options.geocoder;
                      this.backgroundPollingModel = this.options.backgroundPollingModel;
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 3 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-tab/table-tab.js on lines 7..13

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 96.

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

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

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

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

              Refactorings

              Further Reading

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

                    addColumn: function(column){
                      this.newColumnName = "column_" + new Date().getTime();
              
                      this.model.addColumn(this.newColumnName, 'string');
              
              
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 175..182

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 90.

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

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

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

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

              Refactorings

              Further Reading

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

                    cleanEmptyTableInfo: function() {
                      this.$('tfoot').fadeOut('fast', function() {
                        $(this).remove();
                      })
                      this.$('.noRows').slideUp('fast', function() {
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 469..476

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 90.

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

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

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

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

              Refactorings

              Further Reading

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

                    _initBinds: function() {
                      // Geocoder binding
                      this.geocoder.bind('geocodingComplete geocodingError geocodingCanceled', function() {
                        if (this.model.data) {
                          this.model.data().refresh()
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-tab/table-tab.js on lines 26..34

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 85.

              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

                    _swicthEnabled: function() {
                      // Synced?
                      this.$el[ this.model.isSync() ? 'addClass' : 'removeClass' ]('synced');
                      // Visualization?
                      this.$el[ this.vis.isVisualization() ? 'addClass' : 'removeClass' ]('vis');
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 307..312

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

              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

                    needsRender: function(table) {
                      if (!table) return true;
                      var ca = table.changedAttributes();
                      if (ca.geometry_types && _.keys(ca).length === 1) {
                        return false;
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 149..156

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

              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

                    _tableFromQuery: function(e) {
                      e.preventDefault();
              
                      var duplicate_dialog = new cdb.editor.DuplicateDatasetView({
                        model: this.model,
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/header/options_menu.js on lines 153..162

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

              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

                    render: function() {
                      // Since render should be idempotent (i.e. should not append the tableView twice when called multiple times)
                      if(this.tableView && !this.hasRenderedTableView) {
                        this.hasRenderedTableView = true;
                        this.$el.append(this.tableView.el);
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-tab/table-tab.js on lines 56..63

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

              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

                          if (!this.options.geocoder.isGeocoding() && !tableIsReadOnly && canAddGeocoding) {
                            var dlg = new cdb.editor.GeoreferenceView({
                              table:  this.model,
                              user:   this.user,
                              tabs:   ['lonlat', 'city', 'admin', 'postal', 'ip', 'address'],
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/header/options_menu.js on lines 238..250

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 65.

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

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

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

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

              Refactorings

              Further Reading

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

                    activated: function() {
                      if(!this.tableView) {
                        this._createTable();
                        this.tableView.render();
                        this.render();
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-tab/table-tab.js on lines 40..46

              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

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

                    deactivated: function() {
                      if(this.tableView) {
                        this.tableView.clean();
                        this.tableView = null;
                        this.hasRenderedTableView = false;
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-tab/table-tab.js on lines 48..54

              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

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

                      this.scroll_position = { x:$(window).scrollLeft(), y:$(window).scrollTop(), last: 'vertical' };
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 50 mins to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 87..87

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

                    _checkEmptyTable: function() {
                      if(this.isEmptyTable()) {
                        this.addEmptyTableInfo();
                      } else {
                        this.cleanEmptyTableInfo();
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 45 mins to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 409..415

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

                    closeEditor: function() {
                      if (this._editorsOpened) {
                        this._editorsOpened.hide();
                        this._editorsOpened.clean();
                      }
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 4 other locations - About 40 mins to fix
              lib/assets/javascripts/builder/components/form-components/editors/datetime/datetime.js on lines 86..91
              lib/assets/javascripts/builder/components/form-components/field.js on lines 108..113
              lib/assets/javascripts/builder/components/modals/publish/share/share-permission-view.js on lines 130..135
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 390..395

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

                          this.$el.find("thead > tr > th > div > div:not(.dropdown)")
                            .removeAttr('style')
                            .css({"marginLeft": "-" + actual_scroll_position.x + "px"});
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 40 mins to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 350..352

              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

                    _clearView: function(e) {
                      if (e) e.preventDefault();
                      this.options.layer.clearSQLView();
                      return false;
                    },
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 35 mins to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 314..318

              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

                    _startPagination: function(updown) {
                      // Loader... move on buddy!
                      this.$el.find(".page_loader." + updown + "").addClass('active');
                    },
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/tableview.js and 1 other location - About 35 mins to fix
              lib/assets/javascripts/dashboard/views/public-dataset/table-view/table-view.js on lines 242..245

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 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

              There are no issues that match your filters.

              Category
              Status