Showing 829 of 829 total issues
Method format_triggers_on
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def format_triggers_on(field, required = false)
begin
send("#{field}=", json = send(field).gsub('=>', ':'))
hash = JSON.parse(json)
hash.delete('_')
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(message)
parser_options = (message['parser_options'] || {}).dup.with_indifferent_access
parser_options[:create_callback] = -> model {
unless authorize_action(action: :create, klass: model)
fail "Not authorized to create records of type #{model}"
Method write_attribute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_attribute(name, value)
if name.to_s == 'map_attributes'
value.delete('_type')
value.delete(:_type)
value.each do |k, v|
Method parameters
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parameters(*relation_names)
relation_names = relation_names.collect(&:to_s)
@parameters_relations_names = [parameters_relations_names, relation_names].flatten.compact
relation_names.each do |relation_name|
inverse_name = "#{relation_name}_#{to_s.split('::').last.underscore}"
Method to_json_schema
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_json_schema
return documenting(qualify_element(ref).to_json_schema) if ref
json_schema =
{
'title' => name.to_title,
Method to_json_schema
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_json_schema
json = documenting(qualify_type(base).to_json_schema)
@restrictions.each do |key, value|
restriction =
case key
Method parse_viewport
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_viewport(value)
value = value.to_s.split(' ').map do |seq|
seq.chars.inject([]) do |a, char|
case char
when '{', '}'
Method run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
if (translator = agent_from_msg)
unless message[:options].is_a?(Hash)
begin
message[:options] = self.class.parse_options(message[:options].to_s)
- 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_authorization
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_authorization
if using_authorization.present?
field = authorization_handler ? :template_parameters : :headers
auth_params = using_authorization.class.send("auth_#{field}")
conflicting_keys = send(field).select { |p| auth_params.key?(p.key) }.collect(&: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"
Further reading
Method format_triggers_on
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def format_triggers_on(field, required = false)
begin
send("#{field}=", json = send(field).gsub('=>', ':'))
hash = JSON.parse(json)
hash.delete('_')
- 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!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def init!
do_configure = where(origin: :cenit).empty?
Setup::BuildInDataType.each { |dt| dt.db_data_type(true) }
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(options = {})
context_options = try("context_options_for_#{type.to_s.downcase}", options) || {}
self.class.fields.keys.each { |key| context_options[key.to_sym] = send(key) }
self.class.relations.keys.each { |key| context_options[key.to_sym] = send(key) }
context_options[:data_type] = data_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 new_from
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def new_from(data, options = {})
json_data = (data.is_a?(Hash) && data) ||
begin
JSON.parse(data)
rescue
- 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 schema
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def schema
sch =
if type.blank?
{}
elsif %w(integer number boolean string object).include?(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 finish
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def finish(status, message, message_type, time)
self.status = status
thread_token.destroy if thread_token.present?
self.thread_token = nil
Thread.current[:task_token] = nil
- 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 validates_configuration
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validates_configuration
if mime_type.present?
if (extensions = file_extension_enum).empty?
remove_attribute(:file_extension)
elsif file_extension.blank?
- 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 verify_triggers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def verify_triggers
if changed_attributes.key?('triggers')
self.trigger_evaluator = nil unless changed_attributes.key?('trigger_evaluator_id') && trigger_evaluator
elsif changed_attributes.key?('trigger_evaluator_id')
self.triggers = nil unless changed_attributes.key?('triggers') && triggers.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 format_triggers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def format_triggers
if data_type.blank?
errors.add(:data_type, "can't be blank")
elsif triggers.present? && trigger_evaluator.present?
errors.add(:base, 'Can not define both triggers and evaluator')
- 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 get_digest_retry
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_digest_retry(_request, _options = {})
if (execution = self.retry)
if execution.is_a?(Setup::SystemNotification)
fail execution.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 get_digest_reinstall
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_digest_reinstall(_request, _options = {})
if User.current_super_admin?
execution = ::Setup::BuildInAppReinstall.process(
build_in_app_id: id,
task_description: "Re-installing build-in app #{app_module_name}"
- 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"