Showing 583 of 2,698 total issues
Method filter_by_org_guid
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def filter_by_org_guid(org_guids, plan_dataset, broker_dataset, omniscient, readable_orgs_query, readable_spaces_query, dataset)
Method url
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def url(controller, path, page, page_size, order_direction, opts, request_params)
Method serialize_relationships
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def serialize_relationships(relationships, controller, depth, obj, opts, parents, orphans)
Method filter_by_space_guid
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def filter_by_space_guid(space_guids, plan_dataset, broker_dataset, omniscient, readable_orgs_query, readable_spaces_query, dataset)
Method record_continue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.record_continue(deployment, droplet, user_audit_info, v3_app_name, space_guid, org_guid)
Method verify_ports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def verify_ports
@process.route_mappings.each do |mapping|
if mapping.app_port.blank?
return false unless @process.ports.include?(VCAP::CloudController::ProcessModel::DEFAULT_HTTP_PORT)
elsif mapping.has_app_port_specified? && @process.ports.exclude?(mapping.app_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 decorate
has a Cognitive Complexity of 8 (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?
hash[:included] ||= {}
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def perform
not_found! unless service_instance
raise_if_other_operations_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 validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate
return if @process.ports.nil? || @process.ports.empty?
return @errors.add('Process', 'must have at most 10 exposed ports.') if ports_limit_exceeded?
return @errors.add('Ports', 'must be integers.') unless all_ports_are_integers?
return @errors.add('Ports', 'must be in the 1024-65535 range.') unless all_ports_are_in_range?
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def validate
return unless @quota_definition
return unless @process.started?
return if @quota_definition.app_instance_limit == -1 || @process.stopped?
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def perform
not_found! unless service_instance
raise_if_other_operations_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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(process, health_check_timeout, health_check_invocation_timeout, health_check_type, health_check_http_endpoint, health_check_interval)
Method bind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def bind(binding, parameters: {}, accepts_incomplete: false)
client = VCAP::Services::ServiceClientProvider.provide(instance: binding.service_instance)
details = client.bind(
binding,
arbitrary_parameters: parameters,
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def validate
if buildpack_url.present? == admin_buildpack_name.present?
errors.add(:base, Sequel.lit('Must specify either a buildpack_url or an admin_buildpack_name'))
elsif admin_buildpack_name.present?
errors.add(:admin_buildpack_name, Sequel.lit("Specified unknown buildpack name: \"#{admin_buildpack_name}\"")) if Buildpack.find(name: admin_buildpack_name).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 update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update(service_plan, message, append_organizations: false)
type = message.type
requested_org_guids = message.organizations&.pluck(:guid) || []
unprocessable!("cannot update plans with visibility type 'space'") if space?(service_plan)
- 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 normalize_units
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_units(manifest_app_hash)
byte_measurement_key_words = %w[memory disk-quota disk_quota]
manifest_app_hash.each_with_index do |process_hash, index|
byte_measurement_key_words.each do |key|
value = process_hash[key]
- 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_buildpacks_are_ready
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_buildpacks_are_ready(app)
return unless app.buildpack_lifecycle_data
app.buildpack_lifecycle_data.buildpack_lifecycle_buildpacks.each do |blb|
next if blb.custom?
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def start(app:, user_audit_info:, create_revision: true, record_event: true)
app.db.transaction do
app.lock!
process_attributes = { state: ProcessModel::STARTED }
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def decorate(hash, resources)
hash[:included] ||= {}
spaces = resources.map { |r| r.try(:space) || r }.uniq
orgs = spaces.map(&:organization).uniq
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def create(message:, shared_organizations: [])
domain = if message.requested?(:relationships)
PrivateDomain.new(
name: message.name,
owning_organization_guid: message.organization_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"