I've found that kind of feedback to be useful actually. And when giving similar feedback it is received better with a small change in wording to make it more about the code and not the person. Even if that is the intention the wording does matter. For example:
"An external dependency isn't needed here, try implementing with XYZ instead." "Split this function into x and y for better separation of concerns"
Removing the "you" removes some resistance to receiving the message .