Reduce complexity in SelfService::Subscriptions services
Problem
A Code Climate report (attached here) has identified multiple problems with SelfService::Subscriptions::CreateService and SelfService::Subscriptions::UpdateService.
SelfService::Subscriptions::UpdateService
- Method
executehas a Cognitive Complexity of 9 (exceeds 5 allowed) - Method
post_processhas a Cognitive Complexity of 6 (exceeds 5 allowed) - Class
UpdateServicehas 23 methods (exceeds 20 allowed) - Avoid deeply nested control flow statements in
validate_update
SelfService::Subscriptions::CreateService
- Method
executehas a Cognitive Complexity of 17 (exceeds 5 allowed)
Proposal
Let's consider some solutions that can be applied to this class to reduce complexity and address some of these warnings above.
Edited by Tyler Amos

