Noisy dynamics in long and short Josephson junctions