Showing 829 of 829 total issues
Method bind_references
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
def bind_references(record, options = {})
options ||= {}
references = {}
for_each_node_starting_at(record, options) do |obj|
::Setup::Optimizer.instance.regist_data_types(obj)
Class ApiController
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class ApiController < ApplicationController
include OAuth2AccountAuthorization
include CorsCheck
Method []=
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def []=(field, value)
field = field.to_sym
@changed = true
@validated = false
field = :_id if %w(id _id).include?(field.to_s)
Method run
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
if (flow = agent_from_msg)
if flow.active
unless (execution_graph = message[:execution_graph])
execution_graph = message[:execution_graph] = {}
- 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 lazada_rest_api_refresh_token
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def lazada_rest_api_refresh_token(authorization)
if is_time_to_refresh?(authorization, Cenit.delay_time_for_lazada_token_refresh)
client = authorization.client
fail 'Missing client configuration' unless client
fail 'Missing OAuth provider configuration' unless authorization.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
Method new
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def new
response =
{
success: success_report = {},
errors: broken_report = {}
- 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 unique_properties
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def unique_properties
unless @unique_properties
@unique_properties = []
properties.each do |property|
sch = property_schema(property)
- 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
Class LegacyTranslator
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class LegacyTranslator < Translator
include ReqRejValidator
include SnippetCode
# = Translator
#
Class Flow
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Flow
# = Flow
#
# Defines how data is processed by the execution of one or more actions.
Method optimize
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def optimize
data_types = @nss.values.collect { |ns_hash| ns_hash.values.to_a }.flatten
while (data_type = data_types.shift)
segments = {}
refs = Set.new
- 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 to_map_schema
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def to_map_schema(sch)
if sch['type'] == 'object' && (properties = sch['properties']).is_a?(Hash)
new_properties = {}
id_optional = true
properties.each do |property, property_schema|
- 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 to_json_schema
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def to_json_schema
json = documenting('type' => 'object', 'title' => tag_name.to_title)
json['properties'] = properties = {}
required = []
if max_occurs == :unbounded || max_occurs.positive? || min_occurs > 1
- 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
File scheduler.rb
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Setup
class Scheduler < Event
include HashField
include Switchable
# = Scheduler
Class DataType
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class DataType
include SharedConfigurable
include NamespaceNamed
include SchemaHandler
include DataTypeParser
Class JsonDataType
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class JsonDataType < DataType
include Setup::SnippetCode
origins Setup::CrossOriginShared::DEFAULT_ORIGINS
Method validates_configuration
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validates_configuration
format_triggers_on(:scope_filter) if scope_filter.present?
unless requires(:name, :translator)
if event.present?
unless translator.type == :Import || requires(:data_type_scope)
Method run
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
if (source_collection = Setup::Collection.where(id: (source_collection_id = message[:source_collection_id])).first)
if (shared_collection = Setup::CrossSharedCollection.where(id: (shared_collection_id = message[:shared_collection_id])).first)
begin
if shared_collection.installed?
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
message = message.with_indifferent_access
json_schemas = Setup::DataTypeGeneration.data_type_schemas(message[:source], { data_type_names: data_type_names = {} })
json_schemas.each do |ns, data_type_schemas|
existing_data_types = Setup::DataType.any_in(namespace: ns, name: data_type_schemas.keys)
- 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_token
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def post_digest_token(request, _options = {})
error_field = '$'
body = request.body.read
payload =
if body.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 post_digest_schedule
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def post_digest_schedule(request, _options = {})
sch_data = request.body.read.strip
sch_data = sch_data.empty? ? {} : JSON.parse(sch_data)
scheduler =
if sch_data.empty?
- 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"