Showing 583 of 2,698 total issues
Method to_hash
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_hash
health_check_data = { timeout: process.health_check_timeout, invocation_timeout: process.health_check_invocation_timeout, interval: process.health_check_interval }
health_check_data[:endpoint] = process.health_check_http_endpoint if process.health_check_type == HealthCheckTypes::HTTP
readiness_health_check_data = { invocation_timeout: process.readiness_health_check_invocation_timeout, interval: process.readiness_health_check_interval }
Method build_usage_event_json
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_usage_event_json(service_usage_event)
{
'guid' => service_usage_event.guid,
'created_at' => iso8601,
'updated_at' => iso8601,
Method generate_org_quota_single_response
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_org_quota_single_response(list_of_orgs)
{
guid: organization_quota.guid,
created_at: iso8601,
updated_at: iso8601,
Method restage
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def restage(guid)
process = find_guid_and_validate_access(:read_for_update, guid)
validate_process!(process)
Method to_hash
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_hash
metadata = broker_metadata
hash = {
guid: service_offering.guid,
Method modify_transaction
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modify_transaction(changeset)
return if changeset.empty?
uri = URI("#{uaa_target}/oauth/clients/tx/modify")
request_body = batch_request(changeset)
Method find_or_create_valid_route
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def find_or_create_valid_route(app, manifest_route, user_audit_info)
manifest_route[:candidate_host_domain_pairs].each do |candidate|
potential_domain = candidate[:domain]
existing_domain = Domain.find(name: potential_domain)
next unless existing_domain
- 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 index
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def index
message = ProcessesListMessage.from_params(subresource_query_params)
invalid_param!(message.errors.full_messages) unless message.valid?
if app_nested?
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def update
message = SpaceFeatureUpdateMessage.new(hashed_params[:body])
unprocessable!(message.errors.full_messages) unless message.valid?
space = SpaceFetcher.new.fetch(hashed_params[: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_visibility
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def update_visibility(opts={})
service_plan = ServicePlanFetcher.fetch(hashed_params[:guid])
service_plan_not_found! unless service_plan.present? && visible_to_current_user?(plan: service_plan)
unauthorized! unless current_user_can_write?(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 buildpacks_content
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def buildpacks_content
return unless buildpacks.is_a?(Array)
non_string = length_error = false
- 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 has_valid_hash_keys
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def has_valid_hash_keys(service)
valid_service_binding_keys = %i[name parameters binding_name]
return false unless service.is_a?(Hash)
return false unless service.length <= valid_service_binding_keys.length && service.keys.all? { |key| valid_service_binding_keys.include?(key) }
return false unless service.key?(:name)
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_hash(opts={})
hash = {}
redact_vals = opts[:redact]
attrs = opts[:attrs] || export_attrs
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def filter(message, app, space_guids, dataset)
if message.requested?(:current) && app
dataset = dataset.extension(:null_dataset)
return dataset.nullify unless app.droplet
- 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_workpool_thread
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_workpool_thread
Thread.new do
catch(:exit) do
loop do
job, args = @queue.pop
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def start
raise Error.new('Cannot start more than once') if @thread
@thread = Thread.new do
failed = false
- 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 sort_list
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sort_list(list, order_by_method, order_direction)
sorted_list = list.sort do |object1, object2|
value1 = object1.public_send(order_by_method)
value2 = object2.public_send(order_by_method)
next 0 if value1.nil? && value2.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 object_eq
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def object_eq(actual, expected, path=[])
@error_message ||= []
types = [actual, expected].map(&:class).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
Function option
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
Method create
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(app, message, user_audit_info, droplet: nil)
droplet ||= app.droplet
no_assigned_droplet! unless droplet
validate_maximum_disk!(message)