Showing 407 of 407 total issues
Method decode_params
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def decode_params(params, options = {})
key = ENCODED_PARAMS_KEY.to_s
hidden_key = ENCODED_HIDDEN_PARAMS_KEY.to_s
data_params = params[key] || '{}'
hidden_data_params = if params.key?(hidden_key) && params[hidden_key].nil?
Method pick_correct_chunks
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pick_correct_chunks(chunks, opts = {})
GoodData.logger.debug("update_preference") { opts[:update_preference].pretty_inspect }
preference = GoodData::Helpers.symbolize_keys(opts[:update_preference] || {})
preference = Hash[preference.map { |k, v| [k, GoodData::Helpers.to_boolean(v)] }]
Method call
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
results = []
synchronize_clients = params[:segments].map do |segment_hash|
Method call
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
# Generate brick execution id
execution_id = GoodData.gd_logger.execution_id
# Convert possible jruby hash to plain hash
Method export_clone
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def export_clone(options = {})
with_data = options[:data].nil? ? true : options[:data]
with_users = options[:users].nil? ? false : options[:users]
export = {
- 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 []
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def [](id, opts = {})
domain = opts[:domain]
segment = opts[:segment]
fail ArgumentError, 'No :domain specified' if domain.nil?
client = domain.client
- 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 create_expression
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.create_expression(filter, labels_cache, lookups_cache, attr_cache, options = {}, login)
values = filter[:values]
# Do not create MUF for label when all its values is NULL (https://jira.intgdc.com/browse/TMA-1361)
non_null_values = values.select { |value| !value.nil? && value.downcase != 'null' }
return ['TRUE', []] if non_null_values.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"
Further reading
Method call
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
results = ThreadSafe::Array.new
collect_synced_status = collect_synced_status(params)
failed_projects = ThreadSafe::Array.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 call
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
results = []
synchronize_clients = params[:segments].map do |segment_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
Class SchemaBlueprint
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class SchemaBlueprint
attr_accessor :data, :project_blueprint
def initialize(dim, blueprint)
@data = dim
Class RedshiftConnectionInfo
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class RedshiftConnectionInfo < ConnectionInfo
def initialize(connection_info_json)
@json = connection_info_json[GoodData::DataSource::REDSHIFT]
end
Method transfer_processes
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transfer_processes(from_project, to_project, options = {})
options = GoodData::Helpers.symbolize_keys(options)
aliases = {}
to_project_processes = to_project.processes
additional_hidden_params = options[:additional_hidden_params] || {}
Method transfer_attribute_drillpaths
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transfer_attribute_drillpaths(source_project, targets)
semaphore = Mutex.new
# Convert to array
targets = [targets] unless targets.is_a?(Array)
Method create_users
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_users(list, default_domain = nil, opts = { :client => GoodData.connection, :project => GoodData.project })
default_domain_name = default_domain.respond_to?(:name) ? default_domain.name : default_domain
domain = client.domain(default_domain_name)
# Prepare cache for domain users
- 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 delete_segment_by_title
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def delete_segment_by_title(title, segments, days = 14, force = false)
return if segments.empty?
dead_line = Time.now - days * 60 * 60 * 24
filtered_segments = segments.select do |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 log_user_filter_results
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def log_user_filter_results(results, user_filters)
results ||= []
results.each do |result|
user_profile_url = result[:user]
status = result[:status]
- 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 migrate_datasets
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def migrate_datasets(spec, opts = {})
opts = { client: GoodData.connection }.merge(opts)
dry_run = opts[:dry_run]
replacements = opts['maql_replacements'] || opts[:maql_replacements] || {}
update_preference = opts[:update_preference]
- 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 collect_clients
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def collect_clients(params, segment_names = nil)
client_id_column = params.client_id_column&.downcase || 'client_id'
segment_id_column = params.segment_id_column&.downcase || 'segment_id'
project_id_column = params.project_id_column&.downcase || 'project_id'
project_title_column = params.project_title_column&.downcase || 'project_title'
- 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 connect
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def connect(username, password, options = {})
server = options[:server] || Helpers::AuthHelper.read_server
options = DEFAULT_LOGIN_PAYLOAD.merge(options)
headers = options[:headers] || {}
- 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 retryable
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def retryable(options = {}, &_block)
opts = { :tries => 12, :on => RETRYABLE_ERRORS }.merge(options)
retry_exception = opts[:on]
retries = opts[:tries]
- 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"