Showing 5,951 of 5,951 total issues
Function _refreshActions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_refreshActions: function () {
if (this.model.get('isProcessRunning')) {
return;
}
var limit = Math.min(this._iconCollection.length);
- 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 geomColumnTypes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
geomColumnTypes: function (geometryTypes) {
var types = geometryTypes || this.get('geometry_types');
var geomTypes = [];
if (!_.isArray(types)) {
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
Function getGeometryType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getGeometryType: function () {
var types = this.get('geometry_types');
var geomTypes = [];
if (!_.isArray(types)) {
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
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render: function () {
this._$orgSubheader().hide();
const isNewGroup = this._group.isNew();
const templateData = {
- 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 _onChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_onChange: function () {
this._removeChangeListener();
if (!this.hasChanged('status') && this.get('status') === STATUS.fetching) {
// If it is already fetching just redo the fetch with latest attrs
- 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 _inheritStyleColor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_inheritStyleColor: function (styleModel) {
var fill = styleModel.get('fill');
var stroke = styleModel.get('stroke');
var color = (fill && fill.color) || (stroke && stroke.color);
- 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 _createUrlOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_createUrlOptions: function (filter) {
var attr;
if (filter) {
var a = {};
for (var k in this.options.attributes) {
- 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 get_by_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.get_by_id(table_id, viewer_user)
table = nil
return table unless viewer_user
table_temp = Carto::UserTable.where(id: table_id).first.service
- 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 get_all_by_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.get_all_by_names(names, viewer_user)
names.map { |t|
user_id = viewer_user.id
table_name, table_schema = Table.table_and_schema(t)
unless table_schema.nil?
- 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 news_sections
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def news_sections(lines)
sections = []
section_lines = []
section_name = nil
lines.each do |line|
- 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 get_all_user_tables_by_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.get_all_user_tables_by_names(names, viewer_user)
names.map { |t|
user_id = viewer_user.id
table_name, table_schema = Table.table_and_schema(t)
unless table_schema.nil?
- 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 children
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def children
ordered = []
children_vis = Visualization::Collection.new.fetch(parent_id: @id)
if children_vis.count > 0
ordered << children_vis.select { |vis| vis[:prev_id].nil? }.first
- 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 authenticate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def authenticate(username, password)
return false if username.blank? || password.blank?
ldap_connection = Net::LDAP.new(connect_timeout: CONNECTION_TIMEOUT)
ldap_connection.host = self.host
ldap_connection.port = self.port
- 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 fix_analysis_node_queries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fix_analysis_node_queries(old_username, new_user, renamed_tables)
if options && options.key?(:table_name)
old_table_name = options[:table_name]
old_username, old_table_name = old_table_name.split('.') if old_table_name.include?('.')
options[:table_name] = renamed_tables.fetch(old_table_name, old_table_name)
- 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 set_prev_list_item!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_prev_list_item!(other_vis)
repository.transaction do
close_list_gap(other_vis)
# Now insert other_vis after self
- 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 copy_data_layers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def copy_data_layers(origin_map, destination_map, user)
last_data = destination_map.layers.reverse.find(&:data_layer?)
order = if last_data
last_data.order + 1
else
- 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 organization_shared_entities_count
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def organization_shared_entities_count(type)
type ||= @type
user = ::User.where(id: @user_id).first
if user.nil? || user.organization.nil?
0
- 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 set_next_list_item!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_next_list_item!(other_vis)
repository.transaction do
close_list_gap(other_vis)
# Now insert other_vis after self
- 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 data_for_carto_layer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def data_for_carto_layer(layer_vizjson)
# TODO: this id will probably be removed from named maps
data = {
id: layer_vizjson[:id],
layer_name: layer_vizjson[:options][:layer_name],
- 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 run_import
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_import
raise errors.full_messages.join(', ') unless valid?
log.append('=== Downloading ===')
update_attributes(state: STATE_DOWNLOADING)
- 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"