> Likewise, there is popular code that is quite bad or mediocre regardless of number of contributors.
Like what? If you're looking for a JavaScript library for example, you can't really go wrong picking one that has many contributors, an active issue tracker, thousands of stars, lots of forks etc. Unless it's some core part of your stack, I don't see how it's practical to spend a lot of time hunting down super well implemented libraries that aren't likely to be supported in the future because nobody uses them.
> To rephrase: PHP is the most widely used server-side scripting language on the web. That does not make it good.
I'm not a huge fan of PHP but you can still write good software in it.
Libraries are relatively easy to swap out compared to say operating systems and programming languages. Personally I find many of the best libraries tend to be the most popular ones.