I have issue to write a complex selection and Spliting algorithm

We have 6 different phases,
and each phase must work for ( X days ) to finish.

First, server select a group of phases
its may choice 1..6 different modes.
and that must split total_days between selected phases by quantity of
each phase,

also this quantity itself relate to another 12 modes and after calc both
can know current quantity of phase

modes is so much, already
i tried to use to many (if else) for selecting phases and spliting days ,

exist a better way ??

Can you post a simplified version of what you have tried so far?

actually single file of this component is ~500 line
and use to much nested (if else) and that is very unreadable
because used to much condition each relate to physics science.

our system need Spliting time between phases with very different modes.

first way is writing to much pattern matching and unreadable code

second way ??!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.