Showing 2,455 of 5,951 total issues
Function _renderLayerTabPaneView
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_renderLayerTabPaneView: function () {
var self = this;
var analysisPayload = this.options.analysisPayload;
var layerId = this._layerDefinitionModel.get('id');
var canBeGeoreferenced = this._viewState.get('canBeGeoreferenced');
Function exports
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(CodeMirror) {
"use strict";
CodeMirror.defineMode("sql", function(config, parserConfig) {
"use strict";
Class VisualizationQueryBuilder
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Carto::VisualizationQueryBuilder
include Carto::UUIDHelper
def self.user_public_tables(user)
user_public(user).with_type(Carto::Visualization::TYPE_CANONICAL)
File member.rb
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'virtus'
require_relative 'adapter'
require_relative '../../../services/importer/lib/importer'
require_relative '../visualization/collection'
require_relative '../../../services/importer/lib/importer/datasource_downloader'
File user_metadata_export_service.rb
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'json'
require 'carto/export/layer_exporter'
require 'carto/export/data_import_exporter'
require_dependency 'carto/export/connector_configuration_exporter'
Method update
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
Open
def update
valid_password_confirmation
session[:show_dashboard_details_flash] = params[:show_dashboard_details_flash].present?
session[:show_account_settings_flash] = params[:show_account_settings_flash].present?
- Read upRead up
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
exports
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
Open
module.exports = CoreView.extend({
className: 'CDB-Widget-body',
defaults: {
chartHeight: 48 + 20 + 4
Class UserTable
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class UserTable < ActiveRecord::Base
attr_accessor :skip_destroy_dependent_visualizations
PRIVACY_PRIVATE = 0
Class ApplicationController
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ApplicationController < ActionController::Base
include UrlHelper
include Carto::ControllerHelper
include Carto::Common::ControllerHelper
Class Permission
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Carto::Permission < ActiveRecord::Base
class Error < StandardError; end
DEFAULT_ACL_VALUE = [].freeze
MapOverlays
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
Open
cdb.admin.MapOverlays = cdb.core.View.extend({
initialize: function() {
this.overlayViews = [];
this.horizontal_overlays = ["share", "layer_selector", "search"];
Method data
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
Open
def data(options = {})
return {} if @user.nil?
db_size_in_bytes = @user.db_size_in_bytes
data = {
- Read upRead up
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
File catalog.js
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import 'whatwg-fetch';
import { setUrlParameters } from 'new-dashboard/utils/catalog/url-parameters';
import { getBaseURL } from 'new-dashboard/utils/catalog/base-url';
import { getMetricsBaseURL } from '../../utils/catalog/base-url';
File editor.js
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var ACTIVE_LOCALE = window.ACTIVE_LOCALE;
if (ACTIVE_LOCALE !== 'en') {
require('moment/locale/' + ACTIVE_LOCALE);
}
var Locale = require('locale/index');
File permission.rb
has 452 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'active_record'
require_dependency 'cartodb/errors'
class Carto::Permission < ActiveRecord::Base
File analyses.js
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var _ = require('underscore');
var camshaftReference = require('./camshaft-reference');
var AreaOfInfluenceFormModel = require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/area-of-influence-form-model');
var AggregateIntersectionFormModel = require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/aggregate-intersection-form-model');
var FilterIntersectionFormModel = require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-intersection-form-model');
File wizard.js
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// form validation
var alwaysTrueValidator = function(form) { return true };
function columnExistsValidatorFor(column_name) {
File data-layer-view.js
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Backbone = require('backbone');
var _ = require('underscore');
var CoreView = require('backbone/core-view');
var template = require('./data-layer.tpl');
var fetchingTemplate = require('./data-layer-fetching.tpl');
Method data
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def data(options = {})
return {} if @user.nil?
db_size_in_bytes = @user.db_size_in_bytes
data = {
Function tokenBase
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenBase (stream, state) {
var ch = stream.next();
if (ch === '@') {
stream.eatWhile(/[\w\-]/);