You're mixing up two different things.
You talk about coding style, but then you mention test coverage, metrics, etc.
Coding style can certainly be specified - all the requirements document has to state is that "For purposes of code maintenance and consistency, this project will follow these coding styles and standards."
Generally, however, most projects merely require, "Good industry practices" and "a consistent coding style across the project" and leave the actual definition and implementation of that up the to developers.
However, the other issues you're discussing, bad code which required refactoring, tests, coverage, etc (I'd throw LINT and static analysis as well) these should be explicitly specified and required. There's no reason to leave them out of the specification - they are hard metrics that show what type of coding errors (or, getting on the fuzzy line between style and bad code, what type of coding patterns are likely to produce buggy code) are likely in any given code, how well it performs, and how well the tests show correct operation.
In large projects the customer will sit down with the lead developers and go over the LINT configuration, for instance, to make sure it meets their needs and no frivolous errors are slowing down development.
So, in short, yes, all this can (and should, IMHO) be specified for any project of significance.