Also. Cast Iron is a bitch to work on. Getting a screw-jack chain wheel cutter etc. is such a pita, it's often easier to just yank everything out but a stub where it enters the basement wall or a slab and just re-do the whole thing in PVC. It weighs a ton, unless you're working on a horizontal piece of it, it's sometimes a two-man job to hold it in place until you get your first few tightenings on it. And then the cast iron might not crack in a clean line or even something remotely resembling a circle.
My house is an older 1930's "Milwaukee Bungalow", and I have drain weepers around my foundation that also go into the sanitary line, and one really rainy March day when it rained non-stop, and the ground was frozen preventing absorption, the roots from a tree by the street finally choked it off, and I didn't even have a proper cleanout that we could put a rooter snake into. So I had to cut 18" out of the pipe, and graft a PVC cleanout into it.
I have no idea if it's code. Although I did know enough that I had to put cast iron floor joist hangers on everything above it first. Might be a time-bomb waiting if/when I ever want to sell this place and move.
Anything like the OP's photo above, it's GREAT that they yanked any of the old cast iron out for you, and it's not really some sign of some looming trouble. "Looming trouble" might be if they'd had to jackhammer or cut out any of the concrete slab in the basement, but there's no sign they'd done anything out in the yard all the way to the street and the municipal hookup.