Showing 583 of 2,698 total issues
Method purge
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def purge(service_instance)
logger.info("purging service instance #{service_instance.guid}")
service_instance.db.transaction do
service_instance.routes.each do |route|
Method update
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(service_instance, message)
logger = Steno.logger('cc.action.user_provided_service_instance_update')
updates = {}
updates[:name] = message.name if message.requested?(:name)
Function main
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
func main() {
e := echo.New()
e.Logger.SetLevel(log.DEBUG)
diegoURL, err := url.Parse(os.Getenv("DIEGO_URL"))
Method create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(app:, droplet_guid:, environment_variables:, description:, commands_by_process_type:, user_audit_info:)
RevisionModel.db.transaction do
next_version = calculate_next_version(app)
if (existing_revision_for_version = RevisionModel.find(app: app, version: next_version))
Method dispatch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dispatch
logger = Steno.logger('cc.deployment_updater.update')
logger.info('run-deployment-update')
deployments_to_scale = DeploymentModel.where(state: DeploymentModel::DEPLOYING_STATE).all
Method schema
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.schema
lambda { |_dsl|
{
result: {
execution_metadata: String,
Method perform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
resource_dir = generate_resources
resource_timing = resource_match(resource_dir)
puts("resource match timing: #{resource_timing * 1000}ms")
Method tables_for_sequel_case_insensitive_string_monkeypatch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tables_for_sequel_case_insensitive_string_monkeypatch
db.create_table :unique_str_defaults do
primary_key :id
String :str, unique: true
end
Method validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validate
return unless policy_target
return unless additional_checks
if requested_log_rate_limit == VCAP::CloudController::QuotaDefinition::UNLIMITED &&
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def decorate(hash, resources)
hash[:included] ||= {}
spaces = resources.map { |r| r.try(:space) || r }.uniq
all_spaces_readable, readable_space_guids = permissions(spaces)
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def create(message)
Buildpack.db.transaction do
Locking[name: 'buildpacks'].lock!
buildpack = Buildpack.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 update_sync
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_sync
if update_metadata_only?
service_instance.db.transaction do
MetadataUpdate.update(service_instance, message)
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 open_ports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def open_ports
open_ports = ports || []
if docker?
has_mapping_without_port = route_mappings_dataset.where(app_port: ProcessModel::NO_APP_PORT_SPECIFIED).any?
- 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 docker_ports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def docker_ports
exposed_ports = []
if execution_metadata.present?
begin
metadata = Oj.load(execution_metadata)
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def update(accepts_incomplete: false)
client = VCAP::Services::ServiceClientProvider.provide(instance: service_instance)
details, err = client.update(
service_instance,
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 data_content
has a Cognitive Complexity of 10 (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 check_unwritable_spaces
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_unwritable_spaces(space_guids)
unauthorized_space = false
suspended_space = false
space_guids.each do |space_guid|
space = Space.find(guid: space_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
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update
flag = find_flag(hashed_params[:name])
flag_not_found! unless flag
unauthorized! unless permission_queryer.can_write_globally?
- 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 delete
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def delete(service_instance_dataset)
service_instance_dataset.each_with_object([[], []]) do |service_instance, errors_and_warnings|
errors_accumulator, warnings_accumulator = errors_and_warnings
if service_instance.operation_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 update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update
resource_not_found!(:security_group) unless permission_queryer.readable_security_group_guids.include?(hashed_params[:guid])
security_group = SecurityGroup.first(guid: hashed_params[:guid])
unauthorized! unless permission_queryer.can_write_globally?
- 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"