Showing 583 of 2,698 total issues
Avoid too many return
statements within this method. Open
return MetadataError.error("'#{name}' contains invalid characters") unless valid_characters?(name)
Avoid too many return
statements within this method. Open
return MetadataError.error("'#{name}' starts or ends with invalid characters") unless start_end_alphanumeric?(name)
Avoid too many return
statements within this method. Open
return false unless port_list.all? { |p| port_in_valid_range?(p.to_i) }
Avoid too many return
statements within this method. Open
return true if ipv4s.first == sorted_ipv4s.first
Avoid too many return
statements within this method. Open
return false unless port_list.all? { |p| /\A\s*\d+\s*\z/.match(p) }
Avoid too many return
statements within this method. Open
return true
Method send_unbind_to_client
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def send_unbind_to_client(binding)
client = VCAP::Services::ServiceClientProvider.provide(instance: binding.service_instance)
details = client.unbind(
binding,
accepts_incomplete: true,
- 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 decorate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decorate(hash, service_instances)
managed_service_instances = service_instances.select(&:managed_instance?)
return hash if managed_service_instances.empty?
brokers = ServiceBroker.
- 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 validate_total_reserved_route_ports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_total_reserved_route_ports
return unless total_reserved_route_ports
err_msg = Sequel.lit('Total reserved ports must be -1, 0, or a positive integer, and must be less than or equal to total routes.')
route_ports_out_of_range = total_reserved_route_ports < UNLIMITED
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate
return unless @process.docker_image
@errors.add(:docker_image, BUILDPACK_DETECTED_ERROR_MSG) if @process.buildpack_specified?
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create(message:, user_audit_info:, record_event: true)
Steno.logger('cc.action.package_create').info("creating package type #{message.type} for app #{message.app_guid}")
package = PackageModel.new
package.app_guid = message.app_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 validate_quotas!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_quotas!(errors)
quota_errors = errors.on(:quota).to_a
plan_errors = errors.on(:service_plan).to_a
code = if quota_errors.include?(:service_instance_space_quota_exceeded)
- 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 delete_service_instances
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_service_instances(space_model)
space_model.service_instances_dataset.each_with_object([]) do |service_instance, errors|
service_instance_deleter = V3::ServiceInstanceDelete.new(service_instance, @services_event_repository)
result = service_instance_deleter.delete
unless result[:finished]
- 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 find_buildpack_to_update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_buildpack_to_update(found_buildpacks, detected_stack, planned_jobs)
return if found_buildpacks.empty?
ensure_no_buildpack_downgraded_to_nil_stack!(found_buildpacks)
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform
service_instance = ManagedServiceInstance.first(guid: service_instance_guid)
return if service_instance.nil?
intended_operation = service_instance.last_operation
- 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 where
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def where(*cond)
return super if block_given?
filters_per_role = cache_get(:filters_per_role) || init_filters([])
- 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 raise_if_invalid_update!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def raise_if_invalid_update!
return unless message.updates.any?
service_instance.set(message.updates)
return service_instance.reload if service_instance.valid?
- 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_app_revision
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_app_revision(app, user_audit_info)
return nil unless app.revisions_enabled && app.droplet_guid.present?
latest_revision = app.latest_revision
if latest_revision.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 validate_key!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_key!(key, message_name)
return unless key
key_already_exists!(message_name) if key.create_succeeded? || key.create_in_progress?
key_incomplete_deletion!(message_name) if key.delete_failed? || key.delete_in_progress?
- 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 create_space_role
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_space_role(type:, user:, space:)
error!("Users cannot be assigned roles in a space if they do not have a role in that space's organization.") unless space.in_organization?(user)
UsernamePopulator.new(uaa_username_lookup_client).transform(user)
- 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"