Skip to content

Commit

Permalink
Fix CodeClimate Cognitive Complexity issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruikshanks committed Nov 6, 2018
1 parent e306b3a commit 45ee7c8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ def log_status_change
def renewal_allowed?
return false unless %w[ACTIVE EXPIRED].include?(status)
return true if renewal_application_submitted?
return true if renew_expired_registration?

close_to_expiry_date? && should_not_be_expired?
end

def renew_expired_registration?
return true if in_expiry_grace_window?

# The only time an expired registration can be renewed is if the application has previously been submitted,
# or it is withion the grace window - otherwise expiry is an automatic no
return false if EXPIRED?

close_to_expiry_date? && should_not_be_expired?
end

def renewal_application_submitted?
Expand Down

0 comments on commit 45ee7c8

Please sign in to comment.