Showing 359 of 407 total issues
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 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
Avoid too many return
statements within this method. Open
return ads_connection_info if is(ADS)
Avoid too many return
statements within this method. Open
return s3_connection_info if is(S3)
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return modified_input_source
Avoid too many return
statements within this method. Open
return modified_input_source
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return modified_input_source
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return modified_input_source
Method get_user
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_user(slug, user_list = users)
search_crit = if slug.respond_to?(:login)
slug.login || slug.uri
elsif slug.is_a?(Hash)
slug[:login] || slug[:uri]
- 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 datasets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def datasets(id = :all, options = {})
id = id.respond_to?(:id) ? id.id : id
dss = ProjectBlueprint.datasets(self, options).map do |d|
case d[:type]
when :date_dimension
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(init_data)
some_data = if init_data.respond_to?(:project_blueprint?) && init_data.project_blueprint?
init_data.to_hash
elsif init_data.respond_to?(:to_blueprint)
init_data.to_blueprint.to_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
Method sso_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sso_url(login, provider, url, opts = DEFAULT_SSO_OPTIONS)
opts = DEFAULT_SSO_OPTIONS.merge(opts)
ts = DateTime.now.strftime('%s').to_i + opts[:valid]
obj = {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def [](id = :all, opts = { client: GoodData.connection })
c = GoodData.get_client(opts)
pid = (opts[:project].respond_to?(:pid) && opts[:project].pid) || opts[:project]
process_id = (opts[:process].respond_to?(:process_id) && opts[:process].process_id) || opts[:process]
uri = NOTIFICATION_RULES_PATH % [pid, process_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 slice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def slice(rows, cols)
rows = rows.is_a?(Enumerable) ? rows : [rows, size.first]
cols = cols.is_a?(Enumerable) ? cols : [cols, size.last]
new_data = @data[rows.first..rows.last].map { |col| col[cols.first..cols.last] }
if 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_metric
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_metric(options = {})
an_attribute = options[:attribute]
a_type = options[:type] || :count
unless ATTRIBUTE_BASE_AGGREGATIONS.include?(a_type)
fail 'Suggested aggreagtion function (#{a_type}) does not exist for ' \
- 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"