Take the manager's word for it and go all in on nepotism?
What's the better solution?
Note: 'in a standard way across teams'. You have jumped directly to 'can't be measured at all in any circumstances'
How to grade that into any kind of ranking, in a standard way, is seemingly not likely given how subjective the difficulty of a code base is. This also completely elides the clever and best engineers that find ways to simplify and/or avoid solving problems entirely. Further, a team that built a crap pile of bad code, but know it pretty well could seem really productive just because they have built for themselves some job security. Then compound all this with measuring the utility of what was produced.
Also, any investors out there might hear “one time restructuring charge” in the quarterly results when they talk P&L which will affect the bottom line.
Geez, I mean there are decent managers who do rate on performance and not just buddy-buddy stuff. Frankly I'd expect to be trusted with my reviews of people under me.