Here's a tip.
When you change the signature of a function like in this case from
taking a whole pile of Boolean's to taking a struct,
you obviously have to find all of the places that call that function.
Maybe there's 1, maybe there's 7, maybe there's 100.
I don't know your code.
But when you look at those, let's say, seven calls,
do they pass literals like true and false for some of the parameters?
And do they, in fact,
pass the same value for one particular parameter everywhere?
Imagine there's seven different places that make the call to this function,
and all seven of them say false for backupRequired.
There's no way that sometimes we pass true, sometimes we pass false.
They all say false.
So in the body of the function,
whatever code path is involved with backupRequired being true
has probably not been exercised for decades.
You don't even know if it works or not.
Nobody ever passes that value of the parameter.
So maybe we shouldn't have that parameter.
Maybe we should just rip that out.
Take away the parameter, take away the if-else.
Just always do it the way everybody does it.
Yes, yes, 20 years ago, somebody put in a lot of work to let you do it both ways,
triggering reports and not triggering reports,
backupRequired and not backupRequired.
That was work and that was effort, but nobody's using half of that effort.
And one of the things we do when we're modernizing code is we
stopped carrying around code that no one's using.
And so if you have an if-else block where either the if
or the else is never ever happening,
you have no real proof that it's any good anymore.
There could have been changes 15 years ago that made this code not work,
and nobody knows because this code hasn't run in those 15 years.
So if that's the case you find yourself in, strip it down.
You can always get it back from source control if you really need it someday.
Have a shorter, simpler function.
Have less parameters in your options structure.
Take advantage of this opportunity while you're in there to make it something you know actually is being used and works.