CartoDB/cartodb20

View on GitHub

Showing 5,951 of 5,951 total issues

File widgets.js has 733 lines of code (exceeds 250 allowed). Consider refactoring.
Open


/**
 *  Color form view
 *
 *  - It is used in 'Marker fill', 'Polygon fill',...
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 1 day to fix

    Function exports has 337 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      if (timer) timer.init(grunt);
    
      var environment = grunt.option('environment') || DEVELOPMENT;
      grunt.log.writeln('Environment: ' + environment);
    Severity: Major
    Found in Gruntfile.js - About 1 day to fix

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

          if (upload.type) {
            if (upload.type === "file") {
              if (upload.value.length > 1) {
                d.name = upload.value.length + ' files';
              } else {
      lib/assets/javascripts/builder/components/background-importer/background-import-item-view.js on lines 100..125
      lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 66..91

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

      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

          if (upload.type) {
            if (upload.type === 'file') {
              if (upload.value.length > 1) {
                d.name = upload.value.length + ' files';
              } else {
      lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 60..85
      lib/assets/javascripts/dashboard/views/dashboard/imports/background-import-item/background-import-item-view.js on lines 66..91

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

      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

          if (upload.type) {
            if (upload.type === 'file') {
              if (upload.value.length > 1) {
                templateData.name = upload.value.length + ' files';
              } else {
      lib/assets/javascripts/builder/components/background-importer/background-import-item-view.js on lines 100..125
      lib/assets/javascripts/cartodb/common/background_polling/views/imports/background_import_item_view.js on lines 60..85

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

      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

      File visualization.rb has 698 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'active_record'
      require 'cartodb-common'
      require_relative '../visualization/stats'
      require_relative '../quota_checker'
      require_dependency 'carto/named_maps/api'
      Severity: Major
      Found in app/models/carto/visualization.rb - About 1 day to fix

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

        module.exports = CoreView.extend({
        
          tagName: 'ul',
          className: 'Modal-listActions u-flex u-alignCenter ',
        
        
        lib/assets/javascripts/builder/components/modals/dataset-metadata/footer/footer-view.js on lines 4..45

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

        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

        module.exports = CoreView.extend({
        
          tagName: 'ul',
          className: 'Modal-listActions u-flex u-alignCenter ',
        
        
        lib/assets/javascripts/builder/components/modals/map-metadata/footer/footer-view.js on lines 4..45

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

        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

            if (url.indexOf('{x}') < 0 && url.indexOf('tiles.mapbox.com') !== -1) {
              mapbox_id = this._getMapBoxMapID(url);
              if (mapbox_id) {
                type = 'mapbox_id';
                url = mapbox_id;
        lib/assets/javascripts/builder/components/modals/add-basemap/mapbox/mapbox-to-tile-layer-factory.js on lines 37..56

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

        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

            if (url.indexOf('{x}') < 0 && url.indexOf('tiles.mapbox.com') !== -1) {
              mapbox_id = this._getMapBoxMapID(url);
              if (mapbox_id) {
                type = 'mapbox_id';
                url = mapbox_id;
        lib/assets/javascripts/cartodb/common/dialogs/add_custom_basemap/mapbox/mapbox_to_tile_layer_factory.js on lines 36..55

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

        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

        File carto-table-metadata.js has 662 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const _ = require('underscore');
        const $ = require('jquery');
        const Backbone = require('backbone');
        const SQL = require('internal-carto.js').SQL;
        const safeTableNameQuoting = require('dashboard/helpers/safe-table-name-quoting');

          Class ImportJob has 79 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class ImportJob
                include CartoDB::DataMover::Utils
                include CartoDB::DataMover::LegacyFunctions
                attr_reader :logger
          
          
          Severity: Major
          Found in services/user-mover/import_user.rb - About 1 day to fix

            File layer_presenter.rb has 653 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require_dependency 'carto/api/infowindow_migrator'
            require_dependency 'carto/table_utils'
            
            module Carto
              module Api
            Severity: Major
            Found in app/controllers/carto/api/layer_presenter.rb - About 1 day to fix

              File import_user.rb has 653 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'pg'
              require 'redis'
              require 'yaml'
              require 'json'
              require 'logger'
              Severity: Major
              Found in services/user-mover/import_user.rb - About 1 day to fix

                File carto_wizard_forms.js has 652 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                
                (function() {
                
                cdb.admin.forms = {};
                
                

                  File map.js has 650 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  
                  /*
                   * extend infowindow to serialize only the data we need
                   */
                  _.extend(cdb.geo.ui.InfowindowModel.prototype, {
                  Severity: Major
                  Found in lib/assets/javascripts/cartodb/models/map.js - About 1 day to fix

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

                    module.exports = cdb.core.Model.extend({
                      sync: function (method, model, options) {
                        return Backbone.sync('update', model, options);
                      },
                    
                    
                    lib/assets/javascripts/builder/data/user-notifications.js on lines 9..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 267.

                    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

                      _toggleFullScreen: function(ev) {
                    
                        ev.stopPropagation();
                        ev.preventDefault();
                    
                    
                    Severity: Major
                    Found in lib/assets/javascripts/cartodb/table/overlays/zoom.js and 2 other locations - About 1 day to fix
                    lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 152..186
                    lib/assets/javascripts/cartodb/table/overlays/mobile.js on lines 512..546

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

                    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

                      _toggleFullScreen: function(ev) {
                    
                        ev.stopPropagation();
                        ev.preventDefault();
                    
                    
                    lib/assets/javascripts/cartodb/table/overlays/mobile.js on lines 512..546
                    lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 143..178

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

                    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

                      _toggleFullScreen: function(ev) {
                    
                        ev.stopPropagation();
                        ev.preventDefault();
                    
                    
                    Severity: Major
                    Found in lib/assets/javascripts/cartodb/table/overlays/mobile.js and 2 other locations - About 1 day to fix
                    lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 152..186
                    lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 143..178

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language