Showing 583 of 2,698 total issues
Method droplet_buildpack_info
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def droplet_buildpack_info
return nil if droplet.docker?
return nil unless droplet.lifecycle_data&.buildpack_lifecycle_buildpacks
droplet.lifecycle_data.buildpack_lifecycle_buildpacks.map do |buildpack|
- 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 check_utf8_encoding!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_utf8_encoding!(yaml_data)
if yaml_data.is_a?(Hash)
yaml_data.each_value do |value|
check_utf8_encoding!(value)
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 mode_validator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def mode_validator(mode)
return if mode.nil?
unless mode.is_a?(String)
errors.add(:resources, "#{RESOURCE_ERROR_PREAMBLE} a non-string mode") unless errors.added?(
- 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 show
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def show
service_broker = VCAP::CloudController::ServiceBroker.find(guid: hashed_params[:guid])
broker_not_found! unless service_broker
if service_broker.space_guid
- 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 update_or_create_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_or_create_options(hash, opts)
results = {}
attrs = import_attrs || []
attrs -= opts[:only] unless opts[:only].nil?
attrs.each do |attr|
- 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 no_leading_zeros_in_address
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private_class_method def self.no_leading_zeros_in_address(address)
address.split('.') do |octet|
if octet.start_with?('0') && octet.length > 1
octet_parts = octet.split('/')
return false if octet_parts.length < 2
- 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 upload_buildpack
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def upload_buildpack(buildpack, bits_file_path, new_filename)
return false if buildpack.locked
sha256 = Digester.new(algorithm: OpenSSL::Digest::SHA256).digest_path(bits_file_path)
new_key = "#{buildpack.guid}_#{sha256}"
- 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 anonymize_ip
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def anonymize_ip(request_ip)
# Remove last octet of ip if EU GDPR compliance is needed
ip = begin
IPAddr.new(request_ip)
rescue StandardError
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def start
# add quit trap as in QuitTrap monkey patch
trap('QUIT') do
Thread.new { say 'Exiting...' }
stop
- 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 filtered_dataset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def filtered_dataset
filter_args_from_query.inject(@dataset) do |filter, cond|
if cond.is_a?(Hash)
if cond.key?(:organization)
org_filter(filter, cond)
- 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 filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def filter(dataset, message)
dataset = dataset.where(service_instances__name: message.names) if message.requested?(:names)
if message.requested?(:type)
dataset = case message.type
- 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 filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def filter(message, dataset)
dataset = dataset.where(host: message.hosts) if message.requested?(:hosts)
dataset = dataset.where(path: message.paths) if message.requested?(:paths)
- 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 decode_token_with_key
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def decode_token_with_key(auth_token, options)
time = Time.now.utc.to_i
if @alternate_reference_time
time = @alternate_reference_time
@logger.info("using alternate reference time of #{Time.at(@alternate_reference_time)} to calculate token expiry instead of current time")
- 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 query_datetime_values
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def query_datetime_values(key, values, comparison)
# This filter assumes that datetimes might be stored with sub-second precision,
# but the user will only see the times truncated at the second. Chances are that
# queries are based on an object's timestamp rather than an arbitrary time value,
# so we accept any value in that second range. These queries will pick up other
- 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?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def valid?
return @valid if defined? @valid
if @service_instance_data
validate_hash!(:service_instance, @service_instance_data)
- 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?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def valid?
return @valid if defined? @valid
if @create_data
validate_hash!(:create, @create_data)
- 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 synchronize_clients_with_catalog
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def synchronize_clients_with_catalog(catalog)
requested_clients = catalog.services.map(&:dashboard_client).compact
requested_client_ids = requested_clients.pluck('id')
unless cc_configured_to_modify_uaa_clients?
- 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 initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(job, event_repository, event_creation_method, event_type, model_class, model_guid, params={})
Method deployment_for_stopped_app
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def deployment_for_stopped_app(app, message, previous_deployment, previous_droplet, revision, target_state, user_audit_info)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(config, logger, env, params, body, sinatra=nil, dependencies={})