Showing 2,455 of 5,951 total issues
File legacy_functions.rb
has 2551 lines of code (exceeds 250 allowed). Consider refactoring. Open
module CartoDB
module DataMover
module LegacyFunctions
# functions taken from https://github.com/postgis/postgis/blob/svn-trunk/utils/postgis_restore.pl.in#L473
SIGNATURE_RE = /[\d\s;]*(?<type>(?:\S+\s?['class'|'family'|'aggregate'|'domain'|'function'|'cast'|'type']*))\s+(?:[^\s]\s+)?(?<name>[^\(]+)\s*(?:\((?<arguments>.*)\))?/i
Function exports
has a Cognitive Complexity of 241 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (CodeMirror) {
CodeMirror.defineMode('cartocss', function (config) {
var indentUnit = config.indentUnit;
var type;
- 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 exports
has a Cognitive Complexity of 205 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (CodeMirror) {
/*eslint-disable */
var Pos = CodeMirror.Pos;
function SearchCursor(doc, query, pos, caseFold) {
- 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 exports
has a Cognitive Complexity of 187 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (CodeMirror) {
"use strict";
var HINT_ELEMENT_CLASS = "CodeMirror-hint";
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
- 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 db_service.rb
has 1410 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'db_queries'
require_dependency 'carto/db/database'
require_dependency 'carto/db/user_schema_mover'
require 'cartodb/sequel_connection_helper'
require 'carto/configuration'
File chart.js
has 1400 lines of code (exceeds 250 allowed). Consider refactoring. Open
var $ = require('jquery');
var _ = require('underscore');
var d3 = require('d3');
var d3Interpolate = require('d3-interpolate');
var CoreModel = require('backbone/core-model');
Function exports
has a Cognitive Complexity of 155 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (params) {
if (!params.userModel) throw new Error('userModel is required');
if (!params.analysisDefinitionsCollection) throw new Error('analysisDefinitionsCollection is required');
if (!params.analysisDefinitionNodesCollection) throw new Error('analysisDefinitionNodesCollection is required');
if (!params.layerDefinitionsCollection) throw new Error('layerDefinitionsCollection is required');
- 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 exports
has 630 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (params) {
if (!params.userModel) throw new Error('userModel is required');
if (!params.analysisDefinitionsCollection) throw new Error('analysisDefinitionsCollection is required');
if (!params.analysisDefinitionNodesCollection) throw new Error('analysisDefinitionNodesCollection is required');
if (!params.layerDefinitionsCollection) throw new Error('layerDefinitionsCollection is required');
File mapview.js
has 1200 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* map tab shown in cartodb admin
*/
/**
File table.rb
has 1189 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'forwardable'
require_relative './table/column_typecaster'
require_relative './table/privacy_manager'
require_relative './table/relator'
Class User
has 148 methods (exceeds 20 allowed). Consider refactoring. Open
class User < Sequel::Model
include CartoDB::MiniSequel
include CartoDB::UserDecorator
include CartodbCentralSynchronizable
include CartoDB::ConfigUtils
File user.rb
has 1094 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cartodb/per_request_sequel_cache'
require 'cartodb-common'
require 'email_address'
require 'securerandom'
require_relative './user/user_decorator'
Class Visualization
has 136 methods (exceeds 20 allowed). Consider refactoring. Open
class Carto::Visualization < ActiveRecord::Base
include CacheHelper
include Carto::UUIDHelper
include Carto::AuthTokenGenerator
include Carto::VisualizationDependencies
Function exports
has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(CodeMirror) {
"use strict";
CodeMirror.defineMode("sql", function(config, parserConfig) {
"use strict";
- 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 common_passwords.rb
has 1004 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Carto
module CommonPasswords
COMMON_PASSWORDS = ['123456',
'password',
'12345678',
exports
has 123 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = CoreView.extend({
options: {
// render the chart once the width is set as default, provide false value for this prop to disable this behavior
// e.g. for "mini" histogram behavior
showOnWidthChange: true,
File maki_icons.js
has 949 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Maki icons from https://github.com/mapbox/maki
// and https://github.com/mapbox/maki/blob/mb-pages/_includes/maki.json
module.exports = {
disclaimer: '<a href="https://github.com/mapbox/maki" target="_blank">Maki Icons</a>, an open source project by <a href="http://mapbox.com" target="_blank">Mapbox</a>',
icons: [
Class Table
has 120 methods (exceeds 20 allowed). Consider refactoring. Open
class Table
extend Forwardable
include Carto::TableUtils
include ::LoggerHelper
File maki-icons.js
has 941 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Maki icons from https://github.com/mapbox/maki
// and https://github.com/mapbox/maki/blob/mb-pages/_includes/maki.json
module.exports = {
disclaimer: _t('assets.maki-icons.disclaimer'),
icons: [
File data_import.rb
has 927 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'sequel'
require 'fileutils'
require_relative './user'
require_relative './table'
require_relative './visualization/member'