Showing 829 of 829 total issues
Method finish
has 37 lines of code (exceeds 25 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
Method run
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(input = [], task = nil)
input = Cenit::Utility.json_value_of(input)
input = [input] unless input.is_a?(Array)
input = input.dup
input_size = input.length
Method pretty_errors
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pretty_errors(record, stack = Set.new)
return {} unless record
stack << record
errors = record.errors.messages.dup.with_indifferent_access
if errors.key?(:base) && !property?(:base)
Method run
has 36 lines of code (exceeds 25 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] = {}
Method run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(message)
clear_hashes
if pull_request_hash.present?
pull_request_hash[:install] = message[:install].to_b if ask_for_install?
if (pull_parameters = message[:pull_parameters]).is_a?(Hash)
Method process_on
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_on(hash_data, options = {})
options ||= {}
errors.clear
properties_locations.each do |property_location|
property_location.errors.clear
Method where
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def where(expression)
config_criteria = nil
if expression.is_a?(Hash)
nil_configs = false
config_options = {}
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
if (script = agent_from_msg)
result = script.run(self)
klass = Setup::BuildInDataType::SCHEMA_TYPE_MAP.keys.detect do |type|
type && (result.class == type || result.class < 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 where
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def where(expression)
ids = nil
if expression.is_a?(Hash)
binds.each do |metadata|
c_str = expression.delete(metadata.name.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 build_attachment
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_attachment(hash)
unless hash.key?(:filename)
filename = hash[:base_name] || DateTime.now.strftime('%Y-%m-%d_%Hh%Mm%S')
if (content_type = hash[:contentType]) && (types = ::MIME::Types[content_type])
types.each do |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 run_transformation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run_transformation(transformation, source_data_type, source, options)
source = [source] unless source.is_a?(Enumerable)
if (transformation.type == :Export && transformation.try(:bulk_source)) ||
(transformation.type == :Conversion && transformation.try(:source_handler)) #TODO After remove legacy translators check try(:bulk_source) and try(:source_handler)
r = transformation.run(source_data_type: source_data_type, objects: source, save_result: false, options: options)
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def validates_configuration
super
unless requires(:email_channel, :email_data_type)
if transformation.is_a?(Setup::Converter)
unless transformation.source_data_type.eql?(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 validates_configuration
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def validates_configuration
method = output_method
if %w(xml html text).include?(method)
if mime_type.present?
unless mime_type[method]
- 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_indices
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_indices
unique_properties = self.unique_properties
indexed_properties = []
begin
records_model.collection.indexes.each do |index|
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def run(message)
algorithm_id = message[:algorithm_id]
if (algorithm = agent_from_msg)
result = algorithm.run(message[:input], self).capataz_slave
klass = Setup::BuildInDataType::SCHEMA_TYPE_MAP.keys.detect do |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 run_transformation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run_transformation(transformation, source_data_type, source, options)
source = [source] unless source.is_a?(Enumerable)
if (transformation.type == :Export && transformation.bulk_source) ||
(transformation.type == :Conversion && transformation.source_handler)
r = transformation.run(source_data_type: source_data_type, objects: source, save_result: false, options: options)
- 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 parse_connections
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse_connections(namespace, collection)
spec = self.spec_doc
auth = collection[:authorizations].first
collection[:connections] << conn = {
- 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 google_v4_refresh_token
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def google_v4_refresh_token(authorization)
if (refresh_token = authorization.refresh_token) && is_time_to_refresh?(authorization)
fail 'Missing client configuration' unless authorization.client
post = Setup::Connection.post('https://www.googleapis.com/oauth2/v4/token')
http_response = post.submit(
- 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 select_items
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def select_items
asc = true
if (order = query_selector.delete(:order))
order.strip!
asc = !order.match(/^-.*/)
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def post_digest(request, options = {})
readable =
if request.content_type.downcase == 'multipart/form-data'
request.params[:data] || request.params[:file] || fail('Missing data (or file) part')
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"