I fully overhaul and flip a few bikes each year. I only reuse the housing and cables if they look both appropriate and brand new. Brake cable kits are only $9:
https://www.ebay.com/p/1095853911?iid=332006761590
And shift cables are only $1/ea:
https://www.ebay.com/itm/2-x-Stainle...UAAOSwQ6FdJEno
Sometimes I can get away with using old rear cables for the front if they look new after cutting to length.