Showing 570 of 2,676 total issues
Method decode_token_with_key
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def decode_token_with_key(auth_token, options)
time = Time.now.utc.to_i
if @alternate_reference_time
time = @alternate_reference_time
@logger.info("using alternate reference time of #{Time.at(@alternate_reference_time)} to calculate token expiry instead of current time")
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def filter(dataset, message)
dataset = dataset.where(service_instances__name: message.names) if message.requested?(:names)
if message.requested?(:type)
dataset = case message.type
- 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 no_leading_zeros_in_address
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private_class_method def self.no_leading_zeros_in_address(address)
address.split('.') do |octet|
if octet.start_with?('0') && octet.length > 1
octet_parts = octet.split('/')
return false if octet_parts.length < 2
- 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 anonymize_ip
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def anonymize_ip(request_ip)
# Remove last octet of ip if EU GDPR compliance is needed
ip = begin
IPAddr.new(request_ip)
rescue StandardError
- 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 synchronize_clients_with_catalog
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def synchronize_clients_with_catalog(catalog)
requested_clients = catalog.services.map(&:dashboard_client).compact
requested_client_ids = requested_clients.pluck('id')
unless cc_configured_to_modify_uaa_clients?
- 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 filtered_dataset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def filtered_dataset
filter_args_from_query.inject(@dataset) do |filter, cond|
if cond.is_a?(Hash)
if cond.key?(:organization)
org_filter(filter, cond)
- 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_or_create_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_or_create_options(hash, opts)
results = {}
attrs = import_attrs || []
attrs -= opts[:only] unless opts[:only].nil?
attrs.each do |attr|
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def filter(message, dataset)
dataset = dataset.where(host: message.hosts) if message.requested?(:hosts)
dataset = dataset.where(path: message.paths) if message.requested?(:paths)
- 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?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def valid?
return @valid if defined? @valid
if @service_instance_data
validate_hash!(:service_instance, @service_instance_data)
- 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 query_datetime_values
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def query_datetime_values(key, values, comparison)
# This filter assumes that datetimes might be stored with sub-second precision,
# but the user will only see the times truncated at the second. Chances are that
# queries are based on an object's timestamp rather than an arbitrary time value,
# so we accept any value in that second range. These queries will pick up other
- 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 deployment_for_stopped_app
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def deployment_for_stopped_app(app, message, previous_deployment, previous_droplet, revision, target_state, user_audit_info)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(job, event_repository, event_creation_method, event_type, model_class, model_guid, params={})
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(config, logger, env, params, body, sinatra=nil, dependencies={})
Method serialize_relationships
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def serialize_relationships(relationships, controller, depth, obj, opts, parents, orphans)
Method url
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def url(controller, path, page, page_size, order_direction, opts, request_params)
Method filter_by_org_guid
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def filter_by_org_guid(org_guids, plan_dataset, broker_dataset, omniscient, readable_orgs_query, readable_spaces_query, dataset)
Method filter_by_space_guid
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def filter_by_space_guid(space_guids, plan_dataset, broker_dataset, omniscient, readable_orgs_query, readable_spaces_query, dataset)
Method bind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def bind(binding, parameters: {}, accepts_incomplete: false)
client = VCAP::Services::ServiceClientProvider.provide(instance: binding.service_instance)
details = client.bind(
binding,
arbitrary_parameters: parameters,
- 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 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 normalize_units
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_units(manifest_app_hash)
byte_measurement_key_words = %w[memory disk-quota disk_quota]
manifest_app_hash.each_with_index do |process_hash, index|
byte_measurement_key_words.each do |key|
value = process_hash[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"