Before and after of a Hot Water Tank to bring it up to code and pass the safety inspection,
the first picture has a flexible line on the gas and the water which is not allowed due to the possibility of breaking loose.
Updated Gas valve and installed a drip leg. Any particles in the gas line will fall into the drip leg and not into the Hot Water Tank gas valve,
Installed new water supply to the cold side and prevent the corrosion by having all one type of metal.
These standards have been around since the 1970’s and if your tank is not up to code call us today.