Showing 359 of 407 total issues
Method call
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
results = []
client = params.gdc_gd_client
development_client = params.development_client
File process.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'zip'
require 'uri'
require_relative '../helpers/global_helpers'
require_relative '../rest/resource'
Method maqlify_filters
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def self.maqlify_filters(filters, user_profile_mapping, options = {})
fail_early = options[:fail_early] == false ? false : true
users_cache = options[:users_cache]
labels_cache = create_label_cache(filters, options)
small_labels = get_small_labels(labels_cache)
- 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_user_profile_mapping
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def self.create_user_profile_mapping(filters, project_users, options = {})
domain = options[:domain]
found_list = {}
missing_list = []
- 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_date_dimension
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def migrate_date_dimension(params, segment_info)
results = []
client = params.gdc_gd_client
latest_blueprint = segment_info[:from_blueprint]
# don't migrate when latest master doesn't contain custom v2 date.
- 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 profile.rb
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pmap'
require_relative '../rest/object'
require_relative 'project'
Method find
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def find(stuff, opts = { :client => GoodData.connection, :project => GoodData.project })
_client, project = GoodData.get_client_and_project(opts)
stuff.map do |item|
obj = if item.is_a?(String)
- 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_s3_config
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_s3_config(params)
s3_config = {}
if params.key?('aws_client')
GoodData.logger.warn('Found two configuration aws_client and s3_client for S3 input source, use aws_client configuration') if params.key?('s3_client')
raise 'Unable to connect to AWS. Parameter "aws_client" seems to be empty' unless params['aws_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 connect
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def connect(username, password = 'aaaa', opts = {})
execution_id = ""
if username.is_a?(Hash) && username.key?(:execution_id)
execution_id = username[:execution_id]
username.delete(:execution_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 call
has a Cognitive Complexity of 19 (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 validate_input_source
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def validate_input_source(input_source, continue_on_error)
type = input_source[:type] if input_source&.dig(:type)
metric_format = input_source[:metric_format]
if type.blank?
raise "Incorrect configuration: 'type' of 'input_source' is required" unless continue_on_error
- 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 transfer_everything
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def transfer_everything(client, domain, migration_spec, opts = {})
filter_on_segment = migration_spec[:segments] || migration_spec['segments'] || []
GoodData.logger.info('Ensuring Users - warning: works across whole domain not just provided segment(s)')
ensure_users(domain, migration_spec, filter_on_segment)
- 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_response
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def process_response(options = {}, &block)
retries = options[:tries] || Helpers::GD_MAX_RETRY
process = options[:process]
dont_reauth = options[:dont_reauth]
options = options.reject { |k, _| [:process, :dont_reauth].include?(k) }
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
logger = params.gdc_logger
client = params.gdc_gd_client
project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
Method add_user
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_user(user_data, name = nil, opts = { :client => GoodData.connection })
generated_pass = GoodData::Helpers::CryptoHelper.generate_password
domain_name = name || user_data[:domain]
user_data = user_data.to_hash
data = {
Method transfer_everything
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transfer_everything(client, domain, migration_spec, opts = {})
filter_on_segment = migration_spec[:segments] || migration_spec['segments'] || []
GoodData.logger.info('Ensuring Users - warning: works across whole domain not just provided segment(s)')
ensure_users(domain, migration_spec, filter_on_segment)
Method load_data
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_data(params, data_source)
first_name_column = params.first_name_column&.downcase || 'first_name'
last_name_column = params.last_name_column&.downcase || 'last_name'
login_column = params.login_column&.downcase || 'login'
password_column = params.password_column&.downcase || 'password'
Method verify_existing_users
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.verify_existing_users(filters, options = {})
users_must_exist = options[:users_must_exist] == false ? false : true
users_cache = options[:users_cache]
domain = options[:domain]
- 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 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)] }]