tansengming/stripe-rails

View on GitHub

Showing 4 of 9 total issues

Method put! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def put!
if exists?
puts "[EXISTS] - #{@stripe_class}:#{@id}:#{stripe_id}" unless Stripe::Engine.testing
else
object = @stripe_class.create({:lookup_key => @lookup_key}.merge compact_create_options)
Severity: Minor
Found in lib/stripe/prices.rb - About 1 hr to fix

Method callback_matcher has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def callback_matcher(options, block)
case only = options[:only]
when Proc, Method
proc do |target, evt|
block.call(target, evt) if only.call(target, evt)
Severity: Minor
Found in lib/stripe/callbacks/builder.rb - About 1 hr to fix

Method put! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def put!
if exists?
puts "[EXISTS] - #{@stripe_class}:#{@id}" unless Stripe::Engine.testing
else
object = @stripe_class.create({:id => @id}.merge compact_create_options)
Severity: Minor
Found in lib/stripe/configuration_builder.rb - About 45 mins to fix

Method recurring_interval_count_maximum has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def recurring_interval_count_maximum
time_unit = recurring_interval.to_sym
 
return unless VALID_TIME_UNITS.include?(time_unit) && recurring_interval_count.respond_to?(time_unit)
too_long = recurring_interval_count.send(time_unit) > 1.year
Severity: Minor
Found in lib/stripe/prices.rb - About 25 mins to fix
Severity
Category
Status
Source
Language