Showing 5,269 of 5,606 total issues
Method hosted_success
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def hosted_success
customer_info = params.require(:customer).permit!.to_h
braintree_response = braintree_blue_crypt.confirm(customer_info, params.require(:braintree).require(:nonce))
@payment_result = braintree_response&.success?
- 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 props
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def props # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
{
activeDocs: api_docs_services.map do |api_doc| # rubocop:disable Metrics/BlockLength
{
id: api_doc.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 accepted
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def accepted(contract)
return unless should_notify?(contract)
return unless contract.user_account
return unless contract.plan && contract.plan.approval_required?
return if contract.user_account.admins.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 account_is_provider_and_user_of_provider
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def account_is_provider_and_user_of_provider
unless account.is_a?(Account) && account.provider?
errors.add :account, :invalid
return
end
- 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 menu_link
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def menu_link(level, title, path, options = {}, li_options = {}, &block)
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
@referrer_filter = @cinstance.referrer_filters.add(params[:referrer_filter])
if @referrer_filter.persisted?
if request.xhr?
- 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 plan_is_unique
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def plan_is_unique
if plan && user_account && !multiple_applications_allowed?
# All non-deleted cinstance with the same user_account as this one...
others = plan.cinstances.bought_by(user_account)
- 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 set!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set!(name, value)
# DEPRECATED: added on 24th of February 2012
# TODO: replace all calls to .config.set!(:multiple_applications, xx)
# and remove this workaround
if name.to_sym == :multiple_applications
- 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 stylesheet_packs_chunks_tag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def stylesheet_packs_chunks_tag(*packs) # rubocop:disable, Metrics/MethodLength, Metrics/CyclomaticComplexity
@packs ||= []
tags = ''
entrypoints = webpack_manifest['entrypoints']
- 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 search_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def search_path(atom = false)
options = params[:q].blank? ? {} : {:q => params[:q]}
prefix =
if @topic
options.update :topic_id => @topic, :forum_id => @forum
- 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 plan_change_permission
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def plan_change_permission(type, opts = { :new_contract => false })
if opts[:new_contract]
if type == ApplicationPlan && !self.buyer_can_select_plan?
:none
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"
Further reading
Method buyer_changes_plan!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def buyer_changes_plan!(plan)
issuer = self.plan.issuer
permission = issuer.plan_change_permission(self.plan.class)
case permission
- 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 replace_step_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.replace_step_file(name, line_number)
cutting = false
result = []
File.new(name).each_line.with_index do |l,i|
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def create
@referrer_filter = @cinstance.referrer_filters.add(params[:referrer_filter])
if @referrer_filter.persisted?
if request.xhr?
- 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 values_for
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def values_for(admin, cinstance, buyer)
[
cinstance.id,
cinstance.name,
cinstance.plan.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 optional_fields_valid?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def optional_fields_valid?
optional_fields.each do |field_name|
field = field(field_name)
next unless field&.required?
- 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 up
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.up
add_column :accounts, :default_account_plan_id, :integer
add_column :services, :default_application_plan_id, :integer
add_column :services, :default_service_plan_id, :integer
- 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 compute_timeshift_deltas
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_timeshift_deltas(range, shift, granularity, prefix)
raise InvalidParameterError, 'You do not need to call this method for UTC zone (shift == 0)' if shift == 0
prefix = key_for(prefix) + '/hour:'
if granularity == :month # this fixes the behaviour for yearly charts
- 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_attribute_for_validation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_attribute_for_validation(name)
if fields_definitions_source_root && extra_field?(name)
extra_fields.try!(:[], name.to_s)
# domain and self_domain accessors have been deprecated but validation still use them. More info in lib/three_scale/domain_substitution.rb
elsif %i[domain self_domain].include?(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 order_by
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def order_by(column = nil, direction = nil)
column ||= default_sort_column
direction ||= default_sort_direction
return default_search_scope unless allowed_sort_columns
- 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"