Showing 582 of 2,696 total issues
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 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 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 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 raise_if_cannot_update!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def raise_if_cannot_update!
error_code = 'ServiceInstanceWithInaccessiblePlanNotUpdateable'.freeze
update_error = ->(x) { UnprocessableUpdate.new_from_details(error_code, x) }
return if service_instance.service_plan.active?
raise update_error.call('parameters') unless message.parameters.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 entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, org, opts, depth, parents, orphans=nil)
Method entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, route_mapping, opts, depth, parents, orphans=nil)
Method get_exception_from_errors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_exception_from_errors(registration)
errors = registration.errors
broker = registration.broker
if errors.on(:broker_url) && errors.on(:broker_url).include?(: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 data_content
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def data_content
return if data.nil?
errors.add(:data, 'can only accept one key') unless data.keys.length == 1
errors.add(:data, "can only accept key 'guid'") unless data.key?(: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 costs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def costs
cost_result = []
if metadata[:costs]
validation_errors = JSON::Validator.fully_validate(costs_schema, metadata[:costs])
return cost_result unless validation_errors.none?
- 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_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def to_hash(controller, obj, opts, depth, parents, orphans=nil)
Method destroy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def destroy
sidecar = SidecarModel.find(guid: hashed_params[:guid])
resource_not_found!(:sidecar) unless sidecar
space = sidecar.app.space
resource_not_found!(:sidecar) unless permission_queryer.can_read_from_space?(space.id, space.organization_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 size_validator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def size_validator(size)
unless size.is_a?(Integer)
errors.add(:resources, "#{RESOURCE_ERROR_PREAMBLE} a non-integer size_in_bytes") unless errors.added?(
:resources, "#{RESOURCE_ERROR_PREAMBLE} a non-integer size_in_bytes"
)
- 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 entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, plan, opts, depth, parents, orphans=nil)
Method summary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def summary(guid)
org = find_guid_and_validate_access(:read, guid)
spaces = visible_spaces(org).map do |space|
# when we do the quota work, this and the service counts will be kept
# as a running total so that we don't have to compute them on the
- 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 entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, service_binding, opts, depth, parents, orphans=nil)
Method parsed_yaml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parsed_yaml
return @parsed_yaml if @parsed_yaml
bad_request!('Manifest size is too large. The maximum supported size is 1MB.') if request.body.size > 1.megabyte
- 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 entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, obj, opts, depth, parents, orphans=nil)
Method value_error
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def value_error
return MetadataError.none if value.nil? || value == ''
return MetadataError.error("'#{value}' contains invalid characters") unless valid_characters?(value)
return MetadataError.error("'#{value}' starts or ends with invalid characters") unless start_end_alphanumeric?(value)
- 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 add_space_role
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_space_role(user_guid, relationship, space_guid)
space = Space.first(guid: space_guid)
user = User.first(guid: user_guid)
user.username = @uaa_username_lookup_client.usernames_for_ids([user.guid])[user.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"