Showing 5,951 of 5,951 total issues
Method update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
@stats_aggregator.timing('templates.update') do
begin
@template.title = params['title']
- 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 translate_error
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def translate_error(exception)
return exception if exception.blank? || exception.is_a?(String)
case exception
when CartoDB::EmptyFile
- 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 load_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_type(required: true)
@type = params[:type]
id = params[:id] || params[:subscription_id]
if @type.nil? && !(id.nil?) then
# If we don't have the type, we can figure it out from the 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 load_synchronization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_synchronization
@synchronization = Carto::Synchronization::where(id: params[:id]).first
head(404) and return unless @synchronization
head(401) and return unless @synchronization.authorize?(current_user)
end
- 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 dryrun
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dryrun
begin
provider_id = params[:provider_id]
parameters = build_connector_parameters(provider_id, params)
if Carto::Connector.dry_run?(provider_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 get_layers_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_layers_list(url)
request_url = LAYERS_URL % [url]
response = http_client.get(request_url, http_options)
validate_response(request_url, response)
- 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 to_private_poro
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_private_poro
poro = {
id: @visualization.id,
name: @visualization.name,
display_name: @visualization.display_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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
return self unless File.exists?(filepath)
detect_delimiter
- 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 block_size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def block_size(update=true)
if update
if @current_stream_status && (@block_size < MAX_BLOCK_SIZE)
@block_size = [@block_size * BLOCK_FACTOR, MAX_BLOCK_SIZE].min
end
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(endpoint, params, first_request_time=nil, retry_counter=0)
first_request_time ||= Time.now
elapsed = Time.now - first_request_time
if elapsed > @retry_timeout
raise Carto::GeocoderErrors::GmeGeocoderTimeoutError.new('retry timeout expired')
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(uri, options = {})
query = options[:query]
success_codes = options.fetch(:success_codes, [200])
process_response = options.fetch(:process_response, true)
if_match = options[:if_match]
- 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 layer_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def layer_options
layer_opts = @layer.options.nil? ? Hash.new : @layer.options
if layer_opts['table_name'] && !viewer_is_owner?
layer_opts['table_name'] = qualify_table_name
end
- 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 build_maxresults_field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_maxresults_field(user)
if twitter_credit_limits > 0
[remaining_quota, TwitterSearch::SearchAPI::MAX_PAGE_RESULTS].min
else
# user about to hit quota?
- 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 wizard_properties_properties_to_style_properties_properties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wizard_properties_properties_to_style_properties_properties(wizard_properties_properties, type)
spp = {}
wpp = wizard_properties_properties
return spp unless wpp
- 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_subject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_subject
if @total_tables == 1
if @errors.nil?
subject = "Your dataset import just finished"
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 to_poro
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_poro(accessible_dependent_derived_maps: false, context: nil)
return {} if @user_table.nil?
poro = {
id: @user_table.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 get_subresource_metadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_subresource_metadata(id, subresource_id)
@url = sanitize_id(id, subresource_id)
response = http_client.get(METADATA_URL % [@url], http_options)
validate_response(METADATA_URL % [@url], response)
- 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 ensure_georef_status_colummn_valid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ensure_georef_status_colummn_valid
connection.run(%Q{
ALTER TABLE #{@qualified_table_name}
ADD COLUMN cartodb_georef_status BOOLEAN DEFAULT 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
Method load_organization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_organization
@organization = Carto::Organization.where(id: params[:organization_id]).first
render_404 && return unless @organization
unless @organization.admin?(current_user)
render_jsonp({ errors: { organization: 'not admin' } }, 401) && 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
Method store
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def store
begin
count = count + 1 rescue 0
sql = %Q{
WITH
- 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"