Showing 2,455 of 5,951 total issues
exports
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = Table.extend({
classLabel: 'cdb.admin.TableView',
events: CoreView.extendEvents({
File assets-view.js
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
var $ = require('jquery');
var _ = require('underscore');
var CoreView = require('backbone/core-view');
var Backbone = require('backbone');
File arcgis.rb
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'json'
require 'addressable/uri'
require_relative '../base_direct_stream'
require_relative '../../../../../lib/carto/http/client'
File code.js
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
cdb.admin.overlays.Code = cdb.core.View.extend({
className: "code overlay",
template_name: 'table/views/overlays/code',
Function _extract
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
_extract: function(method, extractVariables) {
var columns = [];
if (this.ruleset) {
var definitions = this.ruleset.toList(this.parse_env);
for (var d in definitions) {
- 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
Function _onWizardChange
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
_onWizardChange: function(m) {
var wizardProperties = m.attributes;
var previousWizardProperties = m.previousAttributes();
- 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
Method insert_row!
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def insert_row!(raw_attributes)
primary_key = nil
owner.in_database do |user_database|
schema = user_database.schema(name, schema: owner.database_schema, reload: true).map{|c| c.first}
raw_attributes.delete(:id) unless schema.include?(:id)
- 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
Method public_table
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def public_table
return(render_pretty_404) if @visualization.private?
if @visualization.derived?
if current_user.nil? || current_user.username != request.params[:user_domain]
- 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 carto_editor.js
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Carto CSS editor module
*
* new cdb.admin.mod.CartoCSSEditor({
File histogram.js
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function() {
/*
* Filter's model
*
Class Member
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Member
include ::LoggerHelper
include Carto::Configuration
include Virtus.model
Class Column
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Column
DEFAULT_SRID = 4326
WKB_RE = /^\d{2}/
GEOJSON_RE = /{.*(type|coordinates).*(type|coordinates).*}/m
WKT_RE = /POINT|LINESTRING|POLYGON/
File sessions_controller.rb
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency 'carto/oauth/github/config'
require_dependency 'carto/oauth/google/config'
require_dependency 'carto/saml_service'
require_dependency 'carto/username_proposer'
require_dependency 'carto/email_cleaner'
File vizjson3_presenter.rb
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency 'carto/api/layer_vizjson_adapter'
require_dependency 'carto/api/infowindow_migrator'
require_dependency 'cartodb/redis_vizjson_cache'
require_dependency 'carto/named_maps/template'
require_dependency 'carto/legend_migrator'
Method normalize
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
def normalize(string, transliterate_cyrillic: false)
return '' if string.nil? || string.empty?
n = string.force_encoding("UTF-8")
n.gsub!(/[àáâãäåāă]/, 'a')
File xml.codemirror.js
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
File user_commons.rb
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency 'carto/helpers/batch_queries_statement_timeout'
require_dependency 'carto/helpers/billing'
require_dependency 'carto/helpers/google_maps'
require_dependency 'carto/helpers/has_connector_configuration'
require_dependency 'carto/helpers/limits'
Method valid?
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def valid?
validator.errors.store(:type, "Visualization type is not valid") unless valid_type?
validator.errors.store(:user, "Viewer users can't store visualizations") if user.viewer
validator.validate_presence_of(name: name, privacy: privacy, type: type, user_id: user_id)
- 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
Annotation
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
cdb.admin.overlays.Annotation = cdb.geo.ui.Annotation.extend({
className: "annotation overlay",
template_name: 'table/views/overlays/annotation',
Mobile
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
cdb.admin.overlays.Mobile = cdb.core.View.extend({
className: "cartodb-mobile",
template_name: "table/views/mobile",