Which of these is an example of a metaphor?

"machine guns and rifles . . . like dogs barking on lone farms"
"
heavy guns roared"

"Cautiously he raised himself and peered over the parapet."

"Republicans and Free Staters were waging civil war."
"
a Republican sniper lay watching"