Code quality begins with the language in use. Languages are tools and have strengths and weaknesses. So any definition for code quality must consider that. In particular, quality code exploits the strength of the language while exhibiting minimal dependence on its weaknesses.
Having established that, we then can see that the skill of the coder is really what we are looking for in this metric.
This means that money has no place in this metric. Some of the best code I’ve ever seen never made a dime. It also means that the number of bugs in the code is not a good factor either. Consider that code may work exactly as the requirements dictate thus making the bug an aspect of the requirements and not the code. Conversely, code that flawlessly implements perfectly correct requirements can still be of low quality, so correctness or lack of bugs can only be part of the definition.
This leaves two other things to consider in making our judgment, ease of maintenance and performance when executing.
Ease of maintenance is harder to judge, but it has to do with the difficulty in reading and understanding the code (that, of course brings in another variable, the skill of the reader) that might best be measured in time. It also has to do with the difficulty in changing the code. After all, code that is engineered well anticipates extensions to some degree. So forethought in design that enables changes without whole scale restructuring makes for higher quality. We all have faced the prospect of altering code significantly only to find that we are better off with a complete rewrite.
Performance in execution is more than just speed. It means writing code that is not redundant, as in setting values that remain unchanged within loops rather than outside the loop. The comment above about efficient use of resources is very good as well.