Showing 829 of 829 total issues
Method process_http_connection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_http_connection(connection, template_parameters, verbose_response, last_response, options, &block)
Avoid deeply nested control flow statements. Open
if schema['type'] == 'object' && base_model['type'] != 'object'
schema['properties'] ||= {}
value_schema = schema['properties']['value'] || {}
value_schema = base_model.deep_merge(value_schema)
schema['properties']['value'] = value_schema.merge('title' => 'Value', 'xml' => { 'content' => true })
Method check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check
if super
errors.add(:client, 'provider is not OAuth 2.0 compatible') unless provider.is_a?(Setup::Oauth2Provider)
scopes.each do |scope|
next if scope.provider == provider
- 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
Avoid deeply nested control flow statements. Open
value.delete(k) unless v.is_a?(Hash)
Avoid deeply nested control flow statements. Open
if scheduler
notify(
message: "Detached from scheduler #{scheduler.custom_title} due to overflow cyclic executions",
type: :warning
)
Avoid deeply nested control flow statements. Open
fail "contains an unresolved reference #{ref}" unless options[:silent]
Avoid deeply nested control flow statements. Open
base_model = find_ref_schema(base_model) if base_model.is_a?(String)
Avoid deeply nested control flow statements. Open
value = existing_value.deep_merge(value) { |_, sch_value, ref_value| Cenit::Utility.array_hash_merge(sch_value, ref_value) } if value.is_a?(Hash)
Method run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
if (app = agent_from_msg)
app_module = app.app_module
if (tenant = app.tenant)
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
Avoid deeply nested control flow statements. Open
value.delete(k) unless v.is_a?(String)
Avoid deeply nested control flow statements. Open
schema = { 'properties' => base_properties }.deep_merge(schema) do |_, ref_value, sch_value|
Cenit::Utility.array_hash_merge(ref_value, sch_value)
end unless base_properties.blank?
Avoid deeply nested control flow statements. Open
schema['extends'] = base_model['extends'] if base_model['extends']
Avoid deeply nested control flow statements. Open
value += existing_value if value.is_a?(Array)
Method field_triggers_apply_to?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def field_triggers_apply_to?(field, obj_now, obj_before = nil)
r = true
triggers_hash = JSON.parse(send(field))
triggers_hash.each do |field_name, conditions|
# LEGACY: Transform form old Hash conditions format to new Array conditions format.
- 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
Avoid deeply nested control flow statements. Open
enum = (limit ? model.limit(limit) : model.all).skip(offset).to_enum
Avoid deeply nested control flow statements. Open
value.delete(k) if v.empty?
Method check_snippet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_snippet
if snippet_required?
configure_snippet
if snippet_ref.changed? && !snippet_ref.save
snippet_ref.errors.full_messages.each do |msg|
- 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
Avoid deeply nested control flow statements. Open
next unless (base_properties = base_model['properties'])
Method build_in_provider_id
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_in_provider_id
unless @build_in_provider_id
basic_attrs = {
namespace: 'Cenit',
name: 'OAuth',
- 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
Avoid deeply nested control flow statements. Open
next unless step_count >= step_size