Showing 2,455 of 5,951 total issues
File actions_menu.js
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Actions menu view, aka LayersPanel
*
* - It needs at least visualization and user models.
Method data
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def data(options = {})
db_size_in_bytes = self.db_size_in_bytes
data = {
id: 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
LayerPanelView
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
cdb.admin.LayerPanelView = cdb.admin.RightMenu.extend({
_TEXTS: {
error: {
default: _t('Something went wrong, try again later')
CartoTableMetadata
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
const CartoTableMetadata = Base.extend({
currentLoading: 0, // class variable (shared). I'm still not sure if this is messy as hell or powerfull as a transformer
_TEXTS: {
columnDeleted: 'Your column has been deleted',
File annotation.js
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
cdb.admin.overlays.Annotation = cdb.geo.ui.Annotation.extend({
className: "annotation overlay",
template_name: 'table/views/overlays/annotation',
Function exports
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (CodeMirror) {
/*eslint-disable */
var Pos = CodeMirror.Pos;
function SearchCursor(doc, query, pos, caseFold) {
Class Organization
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class Organization < ActiveRecord::Base
include CartodbCentralSynchronizable
include DataServicesMetricsHelper
include Carto::OrganizationQuotas
Class Layer
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class Layer < ActiveRecord::Base
include Carto::TableUtils
include LayerTableDependencies
include Carto::QueryRewriter
File application_controller.rb
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative '../../lib/cartodb/profiler.rb'
require_dependency 'carto/authentication_manager'
require_dependency 'carto/http_header_authentication'
class ApplicationController < ActionController::Base
Function exports
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (CodeMirror) {
CodeMirror.defineMode('mustache', function () {
return {
token: function (stream, state) {
var ch;
- 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_map
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def public_map
if current_user.nil? && !request.params[:redirected].present?
redirect_url = get_corrected_url_if_proceeds(for_table=false)
unless redirect_url.nil?
redirect_to redirect_url and return
- 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 visualizations_controller.rb
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'visualization_presenter'
require_dependency 'carto/api/vizjson_presenter'
require_relative '../../../models/visualization/stats'
require_relative 'paged_searcher'
require_relative '../controller_helper'
Function _barChart
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
_barChart: function() {
var self = this;
var
Function exports
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var initialized = false;
var routeModel = new Backbone.Model();
// keep last route before a modal, so we can replace /modal with it
var previousRoute;
Function draggableOverlay
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
$.fn.draggableOverlay = function(opt) {
var self = this;
var $rule = null;
var $ruleH = null;
- 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 mustache.js
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
Function GrouperLayerMapView
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GrouperLayerMapView(mapViewClass) {
return {
initialize: function() {
File table-body-view.js
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
var CoreView = require('backbone/core-view');
var $ = require('jquery');
var _ = require('underscore');
var Clipboard = require('clipboard');
var TableBodyRowView = require('./table-body-row-view');
UserModel
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
var UserModel = Backbone.Model.extend({
urlRoot: function () {
var baseUrl = this._configModel.get('base_url');
return baseUrl + '/api/v1/users';
},
exports
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = TableDataCollection.extend({
_ADDED_ROW_TEXT: 'Row added correctly',
_ADDING_ROW_TEXT: 'Adding a new row',
_GEOMETRY_UPDATED: 'Table geometry updated',