i've this code:
for notif in EnvironmentManager.notif {
if let type = notif.type {
switch type {
case .SitterAvailable:
self.manageNotif(notif, title: "Une sitter disponible", storyboardName: "searchGuard", vcName: "searchGuardNCSID")
case .OccasionalAdjustmentReminder:
self.manageNotif(notif, title: "Rappel", storyboardName: "searchGuard", vcName: "searchGuardNCSID")
case .GuardRequest:
self.manageNotif(notif, title: "Nouvelle garde urgente", storyboardName: "EmergencyGuardSitter", vcName: "EmergencyGuardSitterNavigationControllerSID")
case .NewReservationRequest:
self.manageNotif(notif, title: "Nouvelle garde", storyboardName: "GuardWebSitter", vcName: "WebGuardSitterNavigationControllerSID")
case .NewMessage:
self.manageNotif(notif, title: "Nouveau message", storyboardName: "MessageListSitter", vcName: "messageSitterViewNavigationControllerSID")
case .SoonReservationStartReminder:
self.manageNotif(notif, title: "Rappel", storyboardName: "GuardListSitter", vcName: "guardListSitterNavigationControllerSID")
case .ReservationAccepted:
self.manageNotif(notif, title: "Garde acceptée", storyboardName: "GuardListSitter", vcName: "guardListSitterNavigationControllerSID")
case .ReservationRefused:
self.manageNotif(notif, title: "Garde refusée", storyboardName: "GuardListSitter", vcName: "guardListSitterNavigationControllerSID")
case .NewMessageParent:
self.manageNotif(notif, title: "Nouveau Message", storyboardName: "MessageParent", vcName: "messageParentViewNavigationControllerSID")
}
}
}
i want to know how to optimize that for counter cyclomatic complexity this, so without a array of string or something like that,
currently complexity equals 11
thanks for help