CartoDB/cartodb20

View on GitHub

Showing 2,455 of 5,951 total issues

Class VisualizationsController has 43 methods (exceeds 20 allowed). Consider refactoring.
Open

class Admin::VisualizationsController < Admin::AdminController
  include CartoDB, VisualizationsControllerHelper
  include Carto::FrameOptionsHelper
  include Carto::UUIDHelper

Severity: Minor
Found in app/controllers/admin/visualizations_controller.rb - About 5 hrs to fix

    File vis.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    /*
     * this model is created to manage the visualization order. In order to simplify API
     * the order is changed using a double linked list instead of a order attribute.
     */
    Severity: Minor
    Found in lib/assets/javascripts/cartodb/models/vis.js - About 5 hrs to fix

      Function task has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.task = function (grunt) {
        return {
          vendor: {
            expand: true,
            cwd: 'vendor/assets/stylesheets/',
      Severity: Major
      Found in lib/build/tasks/copy.js - About 5 hrs to fix

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

        var _ = require('underscore');
        var Backbone = require('backbone');
        var CoreView = require('backbone/core-view');
        var PanelWithOptionsView = require('builder/components/view-options/panel-with-options-view');
        var StyleContentView = require('./style-content-view');
        Severity: Minor
        Found in lib/assets/javascripts/builder/editor/style/style-view.js - About 5 hrs to fix

          Function validate has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

            validate: function (attrs) {
              if (!attrs) return;
          
              if (attrs.type === 'file') {
                // Number of files
          Severity: Minor
          Found in lib/assets/javascripts/dashboard/data/upload-model.js - About 5 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method update_row! has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

            def update_row!(row_id, raw_attributes)
              retries = 0
          
              rows_updated = 0
              owner.in_database do |user_database|
          Severity: Minor
          Found in app/models/table.rb - About 5 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function tokenBase has 143 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function tokenBase(stream, state) {
              var ch = stream.next();
          
              if (ch == "@") {stream.eatWhile(/[\w\-]/); return ret("meta", stream.current());}
              else if (ch == "/" && stream.eat("*")) {
          Severity: Major
          Found in lib/assets/javascripts/utils/carto.codemirror.js - About 5 hrs to fix

            File header.js has 404 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            
            /**
             *  Common header for vis view ( table | derived )
             *
             *  - It needs a visualization model, config and user data.
            Severity: Minor
            Found in lib/assets/javascripts/cartodb/old_common/header.js - About 5 hrs to fix

              File pages_controller.rb has 403 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'active_support/inflector'
              require 'carto/api/vizjson3_presenter'
              
              require_relative '../../models/table'
              require_relative '../../models/visualization/member'
              Severity: Minor
              Found in app/controllers/admin/pages_controller.rb - About 5 hrs to fix

                CartoDBTableData has 42 functions (exceeds 20 allowed). Consider refactoring.
                Open

                cdb.admin.CartoDBTableData = cdb.ui.common.TableData.extend({
                  _ADDED_ROW_TEXT: 'Row added correctly',
                  _ADDING_ROW_TEXT: 'Adding a new row',
                  _GEOMETRY_UPDATED: 'Table geometry updated',
                
                
                Severity: Minor
                Found in lib/assets/javascripts/cartodb/models/tabledata.js - About 5 hrs to fix

                  File twitter.rb has 401 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'json'
                  
                  require_relative '../util/csv_file_dumper'
                  
                  require_relative '../../../../twitter-search/twitter-search'
                  Severity: Minor
                  Found in services/datasources/lib/datasources/search/twitter.rb - About 5 hrs to fix

                    Method data has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def data(options = {})
                          db_size_in_bytes = self.db_size_in_bytes
                    
                          data = {
                            id: id,
                    Severity: Major
                    Found in app/models/user/user_decorator.rb - About 5 hrs to fix

                      File legend_editor.js has 397 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      
                      /* Widget for the Share Dialog */
                      
                      cdb.admin.mod.LegendWidget = cdb.core.View.extend({
                      
                      
                      Severity: Minor
                      Found in lib/assets/javascripts/cartodb/table/menu_modules/legend_editor.js - About 5 hrs to fix

                        File box.rb has 397 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require_relative '../../../../../lib/carto/http/client'
                        
                        module CartoDB
                          module Datasources
                            module Url
                        Severity: Minor
                        Found in services/datasources/lib/datasources/url/box.rb - About 5 hrs to fix

                          File export-image-pane.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          var $ = require('jquery');
                          var Backbone = require('backbone');
                          var CoreView = require('backbone/core-view');
                          var FooterView = require('./footer/footer-view');
                          var ExportImageFormView = require('./export-image-form-view.js');

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

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

                              Class User has 41 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Carto::User < ActiveRecord::Base
                                include DataServicesMetricsHelper
                                include Carto::AuthTokenGenerator
                                include Carto::UserCommons
                                include CartodbCentralSynchronizable
                              Severity: Minor
                              Found in app/models/carto/user.rb - About 5 hrs to fix

                                File connector.js has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import 'whatwg-fetch';
                                import { getBaseURL } from 'new-dashboard/utils/base-url';
                                
                                /*
                                  DEV CREDENTIALS:
                                Severity: Minor
                                Found in lib/assets/javascripts/new-dashboard/store/actions/connector.js - About 5 hrs to fix

                                  File cartodb_layer.js has 394 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  cdb.admin.CartoDBLayer = cdb.geo.CartoDBLayer.extend({
                                    MAX_HISTORY: 5,
                                    MAX_HISTORY_QUERY: 5,
                                    MAX_HISTORY_TILE_STYLE: 5,
                                  
                                  
                                  Severity: Minor
                                  Found in lib/assets/javascripts/cartodb/models/cartodb_layer.js - About 5 hrs to fix

                                    File Gruntfile.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    var _ = require('underscore');
                                    var timer = require('grunt-timer');
                                    var semver = require('semver');
                                    var jasmineCfg = require('./lib/build/tasks/jasmine.js');
                                    var execSync = require('child_process').execSync;
                                    Severity: Minor
                                    Found in Gruntfile.js - About 5 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language