Showing 583 of 2,698 total issues
Method record_cancel
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.record_cancel(deployment, droplet, user_audit_info, v3_app_name, space_guid, org_guid)
Method assign
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def assign(isolation_segment, organizations)
isolation_segment.db.transaction do
isolation_segment.lock!(:share)
organizations.sort! { |o1, o2| o1.id <=> o2.id }.each do |org|
- 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 calculate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def calculate
if process_has_package || process_has_droplet
return 'FAILED' if package_failed_upload || last_build_failed || last_droplet_failed
return 'STAGED' if (process_has_droplet || process_has_build) &&
build_completed &&
- 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 assign
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def assign(app, droplet)
unable_to_assign! unless droplet.present? && droplet_associated?(app, droplet)
app.db.transaction do
app.lock!
- 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 map_organization_roles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def map_organization_roles(user_guids, org_id)
org = Organization.find(id: org_id)
org_user_guids = subset_of_guids(org.users_dataset, user_guids)
manager_guids = subset_of_guids(org.managers_dataset, user_guids)
auditor_guids = subset_of_guids(org.auditors_dataset, user_guids)
- 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, process, opts, depth, parents, orphans=nil)
Method entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, domain, 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 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 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"
Further reading
Method entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, domain, opts, depth, parents, orphans=nil)
Method entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, service_key, opts, depth, parents, orphans=nil)
Method entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, obj, opts, depth, parents, orphans=nil)
Method to_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def to_hash(controller, obj, 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, user, opts, depth, parents, orphans=nil)
Method entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, service_binding, 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 entity_hash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_hash(controller, service, opts, depth, parents, orphans=nil)