Showing 829 of 829 total issues
Method data_type_schemas
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def data_type_schemas(source, options = {})
options[:schemas] = schemas =
case source
when nil # All schemas
Setup::Schema.all
- 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
if (obj = (obj.reload rescue nil))
Avoid deeply nested control flow statements. Open
unless t_target_dt == sub_map_target_dt
sub_map.errors.add(:transformation, "target data type (#{t_target_dt ? t_target_dt.custom_title : 'nil'}) is invalid (#{sub_map_target_dt.custom_title} expected)")
end
Method store_fields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def store_fields(instance_variable, *fields)
if fields
fail 'Illegal argument' unless fields.present?
fields = [fields] unless fields.is_a?(Enumerable)
instance_variable_set(instance_variable, fields.flatten.collect(&:to_s).uniq.select(&:present?))
- 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 process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process(message = {}, &block)
execution_graph = current_thread_cache.last || {}
if (trigger_flow_id = execution_graph['trigger_flow_id'])
execution_graph[trigger_flow_id] ||= []
adjacency_list = execution_graph[trigger_flow_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 descriptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def descriptions
d = []
if valid?
d << 'View your email' if email?
d << 'View your basic profile' if profile?
- 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 init_heroku_db
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_heroku_db
if ENV['HEROKU_MLAB'] && new_record?
heroku_name = "hub-#{id.to_s}"
app = HerokuClient::App.create(heroku_name)
if app
- 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 post_digest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def post_digest(request, _options = {})
options = JSON.parse(request.body.read)
execution = Setup::Translation.process(
translator_id: id,
data_type_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
Avoid deeply nested control flow statements. Open
if !data.key?(:email) || data[:email] == token_data[:email]
data.merge!(captcha_token.data || {}) { |_, left, right| left || right }
captcha_token.destroy
_, status, response = create_user_with(data)
response
Avoid deeply nested control flow statements. Open
case scope[i]
when '{'
stack += 1
when '}'
stack -= 1
Method new_from_edi
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_from_edi(string_or_readable, options = {})
if data_type_methods.any? { |alg| alg.name == 'new_from_edi' }
return method_missing(:new_from_edi, string_or_readable, options)
end
if options[:data_type_parser]
- 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 post_digest_pull
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def post_digest_pull(request, _options)
data = JSON.parse(request.body.read)
execution = pull(
pull_parameters: data['pull_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
Avoid deeply nested control flow statements. Open
if !error_description && (x_tenant_id || access_token.set_current_tenant!)
access_grant = Cenit::OauthAccessGrant.where(application_id: access_token.application_id).first
if access_grant
@oauth_scope = access_grant.oauth_scope
else
Method post_digest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def post_digest(request, _options = {})
options = JSON.parse(request.body.read)
execution = Setup::Translation.process(
translator_id: id,
data_type_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
Avoid deeply nested control flow statements. Open
rescue Exception => ex
errors = [ex.message]
Avoid deeply nested control flow statements. Open
if (x_tenant_id = request.headers['X-Tenant-Id'])
if (x_tenant = Account.find_where(id: x_tenant_id).first)
Account.current = x_tenant
else
error_description = 'Invalid tenant'
Method get_digest_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_digest_config(_request, _options = {})
if (config = self.config).new_record?
config = {}
else
config = config.to_hash
- 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
if !data.key?(:email) || data[:email] == token_data[:email]
data.merge!(captcha_token.data || {}) { |_, left, right| left || right }
captcha_token.destroy
_, status, response = create_user_with(data)
response
Avoid deeply nested control flow statements. Open
if (filename.nil? || (uploader = find_version(uploader, uploader.path_for(record, field, filename)))) &&
(content = uploader.read)
send_data content,
filename: uploader.identifier,
type: uploader.file.content_type,
Method new_from_xml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_from_xml(string_or_readable, options = {})
if data_type_methods.any? { |alg| alg.name == 'new_from_xml' }
return method_missing(:new_from_xml, string_or_readable, options)
end
if options[:data_type_parser]
- 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"