An example of a metaphor in popular science writing:
"All of these species have a remarkable ability to move about by using a diverse array of swimming, digging, and hopping behaviours. They accomplish this with a virtual Swiss army knife of legs: some are large, others small, some face forward, still others face backward.
Neil Shubin
Shubin, N. (2020). Some Assembly Required. Decoding four billion years of life, from ancient fossils to DNA. Oneworld Publications.
[Possibly the use of the qualification 'virtual' (in '… a virtual Swiss army knife …') is intended to be read as a marker of figurative language (as in 'a sort of Swiss army knife' or 'a kind of Swiss army knife' or 'a Swiss army knife, so to speak') in which case this might better be considered a simile than a metaphor.]
Read about examples of science similes