I stopped reading here:
It’s fine for the algorithm to have separate logical parts, but in a function this is a violation of the single responsibility principle.
If it's contained inside the algorithm, and never done elsewhere, then it's still following the SRP to have the algorithm as a single function. This is just someone who learned a new set of principles and over applies them.