Showing 57 of 65 total issues
Method to_hash
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.to_hash(service_id, plan_id, metric_id, period, value)
Method update_utilization
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_utilization(service_id, app_id, max_utilization, max_record, timestamp)
Method aggregate_values
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def aggregate_values(value, timestamp, keys, cmd, client = storage)
Method delete!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delete!(redis_conns, log_deleted_keys: nil)
services = services_to_delete
logger.info("Going to delete the stats keys for these services: #{services.to_a}")
unless services.empty?
- 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 threescale_extensions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.threescale_extensions(env, params = nil)
options = env['HTTP_3SCALE_OPTIONS'.freeze]
if options
::Rack::Utils.parse_nested_query(options).symbolize_names
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 fetch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch(wait: true, max: nil)
queue, encoded_jobs = wait ? wait_pop_from_queue : try_pop_from_queue(max)
return if !encoded_jobs || encoded_jobs.empty?
# filter_map to ignore `decode_job` errors causing it to return `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 clear_queue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def clear_queue
fetcher = JobFetcher.new(fetch_timeout: 1)
worker = new_worker(fetcher)
queues = fetcher.instance_variable_get(:@queues)
redis = async? ? fetcher.instance_variable_get(:@redis) : dup_resque_redis
- 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 valid_encoding?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_encoding?
self.each do |v|
if v.is_a?(String) || v.is_a?(Array) || v.is_a?(Hash)
return false unless v.valid_encoding?
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 process_parents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_parents(usage)
usage.inject(usage.dup) do |memo, (id, val)|
is_set_op = Usage.is_set?(val)
while (id = parent_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
Method perform_wrapper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform_wrapper(args)
start_time = Time.now.getutc
status_ok, message = perform_logged(*args)
stats_mem = Memoizer.stats
end_time = Time.now.getutc
- 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 resolve_slave
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resolve_slave
@sentinel_endpoints.each do |sentinel_endpoint|
client = Async::Redis::Client.new(sentinel_endpoint, protocol: Protocol::ExtendedRESP2.new(credentials: @sentinel_credentials))
begin
- 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 apply
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply
invalid_exception = RedirectURIInvalid
redirect_uri = if params.has_key? REDIRECT_URL
invalid_exception = RedirectURLInvalid
params[REDIRECT_URL]
- 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 start
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.start(global_options, options, args)
manifest = global_options[:manifest]
return unless manifest
argv = ['puma']
argv_add argv, options[:daemonize], '-d'
- 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 utilization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def utilization(app_usage_reports)
max_utilization = -1.0
max_record = nil
max = proc do |item|
if item.max_value > 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 fix_date_cols
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fix_date_cols(hash, period_val)
DATE_COLS.each do |date_col|
hash[date_col] = if date_col == 'year'
period_val.slice! 0, 4
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 apply
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply
if service.referrer_filters_required? && application.has_referrer_filters?
if application.referrer_filters.any? { |filter| matches?(filter, params[:referrer]) }
succeed!
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 parse_json_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_json_params(params)
# Puma::NullIO (in v4.3.9) does not implement "closed?"
body_closed = if request.body.respond_to?(:closed?)
request.body.closed?
elsif request.body.respond_to?(:eof?)
- 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"