An example of figures of speech used in public science discourse:
"…if you punch an earth-bound asteroid too hard, it will fragment into several smaller but still dangerously sized pieces, effectively turning a cannonball into a shotgun spray. For bigger asteroids or for smaller earth-bound asteroids discovered with little warning time something with more oomph may be required: a nuclear weapon. Park a nuke-armed spacecraft next to the asteroid, detonate, and one side of it [the asteroid] will become severely irradiated. That side will shatter and jettison debris into space, pushing the asteroid away from earth as if it were a rocket. If the asteroid was discovered too late to deflect it away from the earth, we may try to completely vaporise it, with ever more powerful nuclear detonation. A Hail Mary approach, that risks turning the cannonball into a now radioactive shotgun spray."
Dr. Robin George Andrews, journalist and author, was talking on an episode of BBC Inside Science.
The references to cannonballs and shot from guns can be seen as an extended metaphor. ('Punch' is also a metaphor here.)
The reference to the asteroid being like a rocket (as it is propelled by the emission of some of its own material) is a simile.
Read about examples of science similes
To describe vaporising the asteroid as a Hail Mary approach is to employ an idiom where the meaning is only obvious to someone who is aware of the idiomatic use of the term.
Read about communicating science through idioms