Showing 359 of 407 total issues
Method add_computed_attribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_computed_attribute(id, options = {})
metric = options[:metric].is_a?(GoodData::Metric) ? options[:metric].identifier : options[:metric]
attribute = options[:attribute].is_a?(GoodData::Attribute) ? options[:attribute].identifier : options[:attribute]
buckets = options[:buckets].sort_by do |bucket|
bucket.key?(:highest_value) ? bucket[:highest_value] : Float::INFINITY
- 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 construct_payload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def construct_payload(users, operation)
users = users.is_a?(Array) ? users : [users]
{
modifyMembers: {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def [](id, opts = { client: GoodData.connection })
return id if id.instance_of?(GoodData::Dimension) || id.respond_to?(:dimension?) && id.dimension?
if id == :all
Dimension.all({ client: GoodData.connection }.merge(opts))
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
users_brick_users = []
login_column = params.users_brick_config.login_column&.downcase || 'login'
users_brick_data_source = GoodData::Helpers::DataSource.new(params.users_brick_config.input_source)
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
domain_name = params.organization || params.domain
fail "Either organisation or domain has to be specified in params" unless domain_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"
Further reading
Method migrate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def migrate(opts = {})
opts = { client: GoodData.connection, execute_ca_scripts: true }.merge(opts)
client = opts[:client]
fail ArgumentError, 'No :client specified' if client.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 prepare_mapping
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def prepare_mapping(what, for_what = nil, options = {})
project = options[:project] || (for_what.is_a?(Hash) && for_what[:project]) || fail('Project has to be provided')
mapping = if what.is_a?(Hash)
whats = what.keys
to_whats = what.values
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
params = params.to_hash
client = params.gdc_gd_client
domain_name = params.organization || params.domain
fail "Either organisation or domain has to be specified in params" unless domain_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"
Further reading
Method resolve_client_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve_client_id(domain, project, data_product)
md = project.metadata
goodot_id = md['GOODOT_CUSTOM_PROJECT_ID'].to_s
client = domain.clients(:all, data_product).find do |c|
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
domain_name = params.organization || params.domain
fail "Either organisation or domain has to be specified in params" unless domain_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"
Further reading
Method create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create(opts = { client: GoodData.connection })
c = GoodData.get_client(opts)
[:project, :ads].each do |key|
fail "No #{key.inspect} specified" unless opts[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 read_csv_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_csv_file(path)
GoodData.logger.info('Start reading csv file')
res = []
row_count = 0
- 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 executions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def executions
return nil unless @json
url = @json['schedule']['links']['executions']
Enumerator.new do |y|
loop do
- 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 stats_table
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def stats_table(values = stats)
sorted = values.sort_by { |_k, v| v[:avg] }
Terminal::Table.new :headings => %w(title avg min max total calls) do |t|
overall = {
:avg => 0,
- 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 apply
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply
# TODO: Review following connect replacement/reimplementation
# connect
with_project do |project_id|
begin
- 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 poll_on_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def poll_on_response(link, options = {}, &bl)
time_limit = options[:time_limit] || DEFAULT_POLL_TIME_LIMIT
process = options[:process] == false ? false : true
# get the first status and start the timer
- 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 store
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def store(credentials_file_path = Helpers::AuthHelper.credentials_file)
puts 'This will store credentials to GoodData in an UNencrypted form to your harddrive to file ~/.gooddata.'
overwrite = GoodData::CLI.terminal.ask('Do you want to continue? (y/n)')
return if overwrite != 'y'
- 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_error
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def format_error(e, params = {})
return e unless e.respond_to?(:response)
error = MultiJson.load(e.response)
message = GoodData::Helpers.interpolate_error_message(error)
if error && error['error'] && error['error']['errorClass'] == 'com.gooddata.security.authorization.AuthorizationFailedException'
- 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 enrich_error_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def enrich_error_message(exception)
begin
return exception unless exception.response
response = JSON.parse(exception.response.body, symbolize_names: 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 call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
if params.key?('ads_client')
GoodData.logger.info "Setting up ADS connection to #{params['ads_client']['ads_id'] || params['ads_client']['jdbc_url']}"
username = params['ads_client']['username'] || params['GDC_USERNAME']
- 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"