This could be a metaphor or irony depending on the context
Irony can be a word or phrase that says one thing but can hold the exact opposite meaning or something close to opposite.
metaphors are words that hold deeper meaning or mean something else than the literal phrase
"half a loaf is better than none"