It can affect their health but not much, rats have been eating out of dumpsters and human food piles for hundreds of years. I always fed and always will feed my rats lab block - I love the Mazuri brand. I also feed some table scraps along with dry dog and cat food and a bulk gerbil mix. The lab block cuts down on waste and adding the occassional mix and table scrap adds variety where they just dig right in instead of stuffing and then stashing. I bred fancy rats (dumbos, primarily blues, blondes and blacks) and lab block was great for price, storage, nutrition, and reduced the need for chew blocks/chew sticks for their teeth.
To edit: Otherwise, aside from packaged foods I second the recipes listed as long as you have a chew stick for them.