Showing 583 of 2,698 total issues
Method scale_deployment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def scale_deployment
deployment.db.transaction do
app.lock!
return unless deployment.lock!.state == DeploymentModel::DEPLOYING_STATE
- 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 actual_lrp_info
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def actual_lrp_info(process, stats=nil, quota_stats=nil, log_cache_errors=nil, isolation_segment=nil, state=nil)
Method build
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def build(app, space, lifecycle, memory_limit, staging_disk_in_mb, vars_from_message=nil)
Method url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def url(controller, path, page, page_size, order_direction, opts, request_params)
params = {
'page' => page,
'results-per-page' => page_size,
'order-direction' => order_direction
- 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 relationship_link_only?
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def relationship_link_only?(association, associated_controller, relationship_name, opts, depth, parents)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(config, logger, env, params, body, sinatra=nil)
Method render_json
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render_json(controller, dataset, path, opts, request_params)
page = opts[:page] || 1
order_applicator = OrderApplicator.new(opts)
order_direction = opts[:order_direction] || 'asc'
page_size = opts[:results_per_page] || @default_results_per_page
- 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 build_info
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_info(state, actual_lrp, process, stats, quota_stats, log_cache_errors)
Method create_or_update_app
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_or_update_app(process, client)
if (existing_lrp = client.get_app(process))
client.update_app(process, existing_lrp)
else
begin
- 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 actual_lrp_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def actual_lrp_info(process, stats=nil, quota_stats=nil, log_cache_errors=nil, isolation_segment=nil, state=nil)
# rubocop:enable Metrics/ParameterLists
result = {}
bbs_instances_client.lrp_instances(process).each do |actual_lrp|
next unless actual_lrp.actual_lrp_key.index < process.instances
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(config, task, lifecycle_data, run_user, launcher_args, prefix)
Method serializer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.serializer
lambda do |array|
return nil if array.nil?
raise ArgumentError.new('Integer array columns must be passed an array') unless array.is_a?(Array)
raise ArgumentError.new('All members of the array must be integers') unless array.all? { |v| v.is_a? Integer }
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def self.validate(rule)
errs = validate_fields(rule)
return errs unless errs.empty?
destination = rule['destination']
- 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, app_usage_event, opts, depth, parents, orphans=nil)
Method handle_no_running_instances
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_no_running_instances(process)
# case when no actual_lrp exists
if bbs_instances_client.lrp_instances(process).empty?
[fill_unreported_instances_with_down_instances({}, process, flat: false), []]
else
- 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 handle_errors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_errors(actions_that_should_not_exist, actions_that_should_exist, controller, association_name, errors)
error_root_path = "#{controller.path_guid}/#{association_name}"
error_full_path = "#{error_root_path}/:guid"
actions_that_should_not_exist.each do |action|
- 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 set_column_type
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_column_type(name, type, opts={})
if type.to_s == 'String' && opts[:case_insensitive]
raise Error.new('DB adapter does not support case insensitive strings') unless @db.respond_to?(:case_insensitive_string_column_type)
set_column_type_original(
- 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, obj, opts, depth, parents, orphans)
Method validate_all_plan_ids_are_unique
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_all_plan_ids_are_unique
catalog_plans = {}
services.each do |s|
s.plans.each do |p|
if catalog_plans[p.broker_provided_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
Consider simplifying this complex logical expression. Open
if((!e.simulated && (timeDiff < 500 || (timeDiff < 1500 && xyDiff[0] < 50 && xyDiff[1] < 50))) || standAlone) {
e.preventDefault();
e.stopPropagation();
if(!standAlone) return false;
}