It is generally not safe to eat undercooked cod or any fish or meat. Raw fish can increase the risk of foodborne illnesses and shoudl be cooked through. You should be able to tell that cod is undercooked by piercing a fork into the middle part, it will look translucent and thick on the inside. I highly recommend having a handy tool in your kitchen - a good digital kitchen thermometer.