Showing 583 of 2,698 total issues
Method render_json
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_json(controller, dataset, path, opts, request_params)
Method build_eager_load_hash
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_eager_load_hash(controller_class, model_class, default_visibility_filter, additional_visibility_filters, depth)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(blobstore_options, package_blobstore, buildpack_cache_blobstore, admin_buildpack_blobstore, droplet_blobstore)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(blobstore_options, package_blobstore, buildpack_cache_blobstore, admin_buildpack_blobstore, droplet_blobstore)
Method handle_errors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_errors(actions_that_should_not_exist, actions_that_should_exist, controller, association_name, errors)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(src_process, dest_process, app_event_repo, user, email)
Method validate_rules
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_rules
return true unless rules
unless rules.is_a?(Array) && rules.all? { |r| r.is_a?(Hash) }
errors.add(:rules, "value must be an array of hashes. rules: '#{rules}'")
- 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 around_save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def around_save
yield
rescue Sequel::UniqueConstraintViolation => e
raise e unless e.message.include?('apps_v3_space_guid_name_index')
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create(message)
org_quota = nil
QuotaDefinition.db.transaction do
org_quota = VCAP::CloudController::QuotaDefinition.create(
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def validate
return unless policy_target
return unless additional_checks
return unless instance_memory_limit != VCAP::CloudController::QuotaDefinition::UNLIMITED && resource_memory > instance_memory_limit
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create(message, organization:)
space_quota = nil
SpaceQuotaDefinition.db.transaction do
space_quota = VCAP::CloudController::SpaceQuotaDefinition.create(
- 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 before_enqueue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def before_enqueue(job)
if existing_guid && (existing = PollableJobModel.find(guid: existing_guid))
state = @handler.try(:pollable_job_state) || PollableJobModel::POLLING_STATE
existing.update(
delayed_job_guid: job.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 remove_default_missing_fields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remove_default_missing_fields(existing_value, current_key, value)
identifying_field = IDENTIFIERS[current_key]
existing_value.each_with_index do |resource, i|
manifest_app_hash_resource = value.find { |hash_resource| hash_resource[identifying_field] == resource[identifying_field] }
if manifest_app_hash_resource.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 apply
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply(org_quota, message)
orgs = valid_orgs(message.organization_guids)
if org_quota.log_rate_limit != QuotaDefinition::UNLIMITED
affected_processes = Organization.where(Sequel[:organizations][:id] => orgs.map(&: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 apply
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply(space_quota, message, visible_space_guids: [], all_spaces_visible: false)
spaces = valid_spaces(message.space_guids, visible_space_guids, all_spaces_visible, space_quota.organization_id)
if space_quota.log_rate_limit != QuotaDefinition::UNLIMITED
affected_processes = Space.where(Sequel[:spaces][:id] => spaces.map(&: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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
unauthorized! unless permission_queryer.can_write_globally?
message = StackCreateMessage.new(hashed_params[:body])
unprocessable!(message.errors.full_messages) unless message.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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
unauthorized! unless permission_queryer.can_write_globally?
message = SecurityGroupCreateMessage.new(hashed_params[:body])
unprocessable!(message.errors.full_messages) unless message.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 valid_destination_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_destination_type(destination, record, index)
error_message = 'destination must be a valid CIDR, IP address, or IP address range'
if CloudController::RuleValidator.comma_delimited_destinations_enabled?
error_message = 'nil destination; destination must be a comma-delimited list of valid CIDRs, IP addresses, or IP address ranges'
end
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
unauthorized! unless permission_queryer.can_write_globally?
message = BuildpackCreateMessage.new(hashed_params[:body])
unprocessable!(message.errors.full_messages) unless message.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 fetch_credentials_from_cache
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch_credentials_from_cache(item)
if item[:is_managed_service]
credentials = item.credentials
cert = credentials&.fetch('cert', '') || ''
key = credentials&.fetch('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"