CartoDB/cartodb20

View on GitHub

Showing 5,951 of 5,951 total issues

Function getPlainSql has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getPlainSql: function () {
    let sql;
    if (this.options.sql) {
      sql = this.options.sql;
    } else {

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 _initBinds has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _initBinds: function () {
    this.upload.bind('change', function () {
      this.trigger('change:upload', this);
    }, this);

Severity: Minor
Found in lib/assets/javascripts/dashboard/views/dashboard/create-map-model.js - About 25 mins 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 _checkOngoingGeocoding has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _checkOngoingGeocoding: function (model) {
    if (!this._visModel) {
      // If there is NOT a vis, let's start polling
      // this geocoding model
      this.add(model);

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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  initialize: function (attrs, opts) {
    attrs = attrs || {};
    opts = opts || {};
    this.tables = [];
    // Removing avatar_url attribute if it comes as null
Severity: Minor
Found in lib/assets/javascripts/dashboard/data/user-model.js - About 25 mins 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 sync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  sync: function (method, model, options) {
    if (!options) { options = {}; }
    options.data = this._createUrlOptions(function (d) {
      return d !== 'sql';
    });
Severity: Minor
Found in lib/assets/javascripts/dashboard/data/table/carto-table-data.js - About 25 mins 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 _renderConfirmChangeLock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _renderConfirmChangeLock: function () {
    // An entity can be an User or Organization
    const itemsCount = this.model.get('items').length;
    const areLocked = this.model.get('initialLockValue');
    const viewTemplate = this.options.template || template;

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 create_in_central has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def create_in_central
    if Cartodb::Central.message_broker_sync_disabled?
      log_central_unavailable
      return true
    end
Severity: Minor
Found in app/models/concerns/cartodb_central_synchronizable.rb - About 25 mins 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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function (opts) {
  if (opts.basemap.urlTemplate) {
    const map = L.map(opts.el, {
      zoomControl: false,
      minZoom: 6,
Severity: Minor
Found in lib/assets/javascripts/dashboard/components/create-fallback-map.js - About 25 mins 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 getModifiedFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var getModifiedFiles = function () {
  modifiedFiles()
    .then(function (files) {
      var newFiles = _.difference(files, fileList);
      var removedFiles = _.difference(fileList, files);
Severity: Minor
Found in lib/build/branchFiles/branchFiles.js - About 25 mins 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 rename_column has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def rename_column(old_name, new_name='')
    raise 'Please provide a column name' if new_name.empty?
    raise 'This column cannot be renamed' if CARTODB_COLUMNS.include?(old_name.to_s)

    if CartoDB::Importer2::Column.reserved_or_unsupported?(new_name) || CARTODB_COLUMNS.include?(new_name)
Severity: Minor
Found in app/models/table.rb - About 25 mins 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_in_central has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def update_in_central
    if Cartodb::Central.message_broker_sync_disabled?
      log_central_unavailable
      return true
    end
Severity: Minor
Found in app/models/concerns/cartodb_central_synchronizable.rb - About 25 mins 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 _getUserType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _getUserType: function () {
    var accountType = this._userModel.get('account_type').toLowerCase();

    // Get user type
    if (this._userModel.isOrgOwner()) {
Severity: Minor
Found in lib/assets/javascripts/dashboard/components/support-view.js - About 25 mins 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 allowed_attributes_to_central has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def allowed_attributes_to_central(action)
    if organization?
      case action
      when :create
        raise "Can't create organizations from editor"
Severity: Minor
Found in app/models/concerns/cartodb_central_synchronizable.rb - About 25 mins 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 prefixUrlPathname has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  prefixUrlPathname: function () {
    var prefix = this.prefixUrl();
    if (prefix !== '') {
      try {
        if (prefix && prefix.indexOf('/') === -1) throw new TypeError('invalid URL');
Severity: Minor
Found in lib/assets/javascripts/dashboard/data/config-model.js - About 25 mins 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_the_geom! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def update_the_geom!(attributes, primary_key)
    return unless attributes[THE_GEOM].present? && attributes[THE_GEOM] != 'GeoJSON'
    geojson = attributes[THE_GEOM]

    begin
Severity: Minor
Found in app/models/table.rb - About 25 mins 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 _checkStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _checkStatus: function () {
    if (!this.get('id') && !this._uploadModel.isValid()) {
      this.trigger('change:upload');
      return;
    }
Severity: Minor
Found in lib/assets/javascripts/dashboard/data/imports-model.js - About 25 mins 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 cartodbfy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def cartodbfy
    start = Time.now
    schema_name = owner.database_schema
    table_name = "#{owner.database_schema}.#{self.name}"

Severity: Minor
Found in app/models/table.rb - About 25 mins 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 add_column! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def add_column!(options)
    raise CartoDB::InvalidColumnName if CartoDB::Importer2::Column.rejected?(options[:name])
    type = options[:type].convert_to_db_type
    cartodb_type = options[:type].convert_to_cartodb_type
    # FIXME: consider CartoDB::Importer2::Column.get_valid_column_name with CURRENT_COLUMN_SANITIZATION_VERSION
Severity: Minor
Found in app/models/table.rb - About 25 mins 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 getAssetsVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getAssetsVersion: function (version) {
    const query = window.location.search.substring(1);
    const vars = query.split('&');
    let i = 0;

Severity: Minor
Found in lib/assets/javascripts/dashboard/helpers/assets-version.js - About 25 mins 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 the_geom_type= has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def the_geom_type=(value)
    self.the_geom_type_value = case value.downcase
      when 'geometry'
        'geometry'
      when 'point'
Severity: Minor
Found in app/models/table.rb - About 25 mins 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

Severity
Category
Status
Source
Language