I am renting a home that had to have the gas water heater replaced. The landlord had someone install the new one and the connections are questionable. My plumber informed me that using cpvc with shark bites directly out of the tank instead of soldering copper lines in was not only lazy but not to code, also the expansion tank was removed and never reinstalled. Any help confirming this job was done incorrect and incomplete would be very much appreciated
Virginia code regarding materials for water heater hookups doesn't get too specific but does to say to make sure you're in accordance with the water heater's manual.
I'm not sure what model you have but the instructions for a current Whirlpool electric water say CPVC is fine (see page 6, item 3). It also recommends compression fittings if you don't want to solder, but doesn't specifically prohibit Sharkbites.
Also the code is OK with CPVC. I took a look for something specifit to within 'X' distance of a water heater and didn't see anything. Here's the link for the code if you'd like to take a look yourself.
Expansions tanks are required if you have a Pressure reducing value (PRV) or backflow preventer. If you do not then there's no need for an expansion tank.
Local codes may superceed state codes, so check what your county & town say. If you call the inspector's office and set up a time to call and speak with an inspector, they should be happy to answer your questions. And if this was installed without a permit they'll be interested to hear about that as well probably. (And if it was installed with a permit it should have been inspected, which would mean it's fine).