CartoDB/cartodb20

View on GitHub

Showing 5,951 of 5,951 total issues

Avoid too many return statements within this method.
Open

        return render_jsonp({ error: 'data parameter must be encoded in base64' }, 400)
Severity: Major
Found in app/controllers/carto/api/public/apps_controller.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return render_jsonp({ error: 'data parameter must be encoded in base64' }, 400)
    Severity: Major
    Found in app/controllers/carto/api/public/custom_visualizations_controller.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return render(file: 'public/static/show/index.html', layout: false)
      Severity: Major
      Found in app/controllers/admin/visualizations_controller.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return(redirect_to protocol: 'https://') if @visualization.is_privacy_private? \
        Severity: Major
        Found in app/controllers/admin/visualizations_controller.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return(public_map_protected) if @visualization.password_protected?
          Severity: Major
          Found in app/controllers/admin/visualizations_controller.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return "link local addresses are not allowed"
            Severity: Major
            Found in lib/ip_checker.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return "loopback addresses are not allowed"
              Severity: Major
              Found in lib/ip_checker.rb - About 30 mins to fix

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

                  _addNotification: function (notificationId, notificationAttrs) {
                    notificationAttrs = _.extend({
                      id: notificationId
                    }, notificationAttrs);
                    Notifier.addNotification(notificationAttrs);
                Severity: Major
                Found in lib/assets/javascripts/builder/cartocss-notifications.js and 3 other locations - About 30 mins to fix
                lib/assets/javascripts/builder/editor/layers/analysis-views/analysis-notifications.js on lines 112..117
                lib/assets/javascripts/builder/sql-notifications.js on lines 52..57
                lib/assets/javascripts/builder/widgets-notifications.js on lines 122..128

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _addNotification: function (notificationId, notificationAttrs) {
                    notificationAttrs = _.extend({
                      id: notificationId
                    }, notificationAttrs);
                
                
                Severity: Major
                Found in lib/assets/javascripts/builder/widgets-notifications.js and 3 other locations - About 30 mins to fix
                lib/assets/javascripts/builder/cartocss-notifications.js on lines 56..61
                lib/assets/javascripts/builder/editor/layers/analysis-views/analysis-notifications.js on lines 112..117
                lib/assets/javascripts/builder/sql-notifications.js on lines 52..57

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _toggleOverlay: function () {
                    var isDisabled = this._overlayModel.get('visible');
                    this.$el.toggleClass('is-disabled', isDisabled);
                  },
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-content-view.js on lines 106..109
                lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 64..67
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 130..133

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _addNotification: function (notificationId, notificationAttrs) {
                    notificationAttrs = _.extend({
                      id: notificationId
                    }, notificationAttrs);
                    Notifier.addNotification(notificationAttrs);
                Severity: Major
                Found in lib/assets/javascripts/builder/sql-notifications.js and 3 other locations - About 30 mins to fix
                lib/assets/javascripts/builder/cartocss-notifications.js on lines 56..61
                lib/assets/javascripts/builder/editor/layers/analysis-views/analysis-notifications.js on lines 112..117
                lib/assets/javascripts/builder/widgets-notifications.js on lines 122..128

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _addNotification: function (notificationId, notificationAttrs) {
                    notificationAttrs = _.extend({
                      id: notificationId
                    }, notificationAttrs);
                    Notifier.addNotification(notificationAttrs);
                lib/assets/javascripts/builder/cartocss-notifications.js on lines 56..61
                lib/assets/javascripts/builder/sql-notifications.js on lines 52..57
                lib/assets/javascripts/builder/widgets-notifications.js on lines 122..128

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _toggleOverlay: function () {
                    var isDisabled = this._overlayModel.get('visible');
                    this.$el.toggleClass('is-disabled', isDisabled);
                  },
                lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 84..87
                lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 64..67
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 130..133

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _toggleOverlay: function () {
                    var isDisabled = this._overlayModel.get('visible');
                    this.$el.toggleClass('is-disabled', isDisabled);
                  },
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-content-view.js on lines 106..109
                lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 84..87
                lib/assets/javascripts/builder/editor/style/style-cartocss-view.js on lines 64..67

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 45.

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

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

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

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

                Refactorings

                Further Reading

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

                  _toggleOverlay: function () {
                    var isDisabled = this._overlayModel.get('visible');
                    this.$el.toggleClass('is-disabled', isDisabled);
                  },
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analyses-content-view.js on lines 106..109
                lib/assets/javascripts/builder/editor/layers/layer-content-views/data/data-content-view.js on lines 84..87
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 130..133

                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

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

                  _initViewState: function () {
                    this._viewState = new Backbone.Model({
                      isDataFiltered: false
                    });
                
                
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
                lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
                lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

                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

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

                  _initViewState: function () {
                    this._viewState = new Backbone.Model({
                      anyGeometryData: true
                    });
                
                
                Severity: Major
                Found in lib/assets/javascripts/builder/editor/widgets/widgets-view.js and 6 other locations - About 30 mins to fix
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
                lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
                lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86

                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

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

                  _initViewState: function () {
                    this._viewState = new Backbone.Model({
                      canBeGeoreferenced: false
                    });
                    this._setViewState();
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
                lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
                lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
                lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

                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

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

                  _initViewState: function () {
                    this._viewState = new Backbone.Model({
                      hasGeometry: true
                    });
                    this._setViewState();
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
                lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
                lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
                lib/assets/javascripts/builder/editor/style/style-content-view.js on lines 80..86
                lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

                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

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

                  _initViewState: function () {
                    this._viewState = new Backbone.Model({
                      isDataFiltered: false
                    });
                
                
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-edition-view.js on lines 49..54
                lib/assets/javascripts/builder/dataset/dataset-options/dataset-actions-view.js on lines 46..51
                lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-controls-view.js on lines 105..110
                lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindows-view.js on lines 46..52
                lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/legends-view.js on lines 58..64
                lib/assets/javascripts/builder/editor/widgets/widgets-view.js on lines 71..77

                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

                Severity
                Category
                Status
                Source
                Language