> How about a feature to open a bounty and pay real money to people who refactor the code, and only the refactoror and initiator can see the code?
Privacy is the trick bit, I guess you are right there's no way to keep code completely proprietary.
I was thinking from my own experience, I have worked for big companies that have tons of legacy code that were written in subpar standard, sometimes developers were asked to refactor a piece of code written in a technology they are not familiar with. Have a refactor tool like this can serve as a mini contract to outside developers (or QA in some perspective).
Any reasonable sized company will have some rules regarding proprietary information, it's very unlikely they'll allow employee to publish company's code to an open community, so some restrictions need to be applied. However, if you want to focus on open source projects then none of this matters.
How about create a group, and only people with certain privilege can join, for example, a "Java Consultant" group that only people with >1000 reputations can join. On joining this group you also have to agree to extra terms and conditions, ie. not to disclose code you've seen or use it on your own. And when you start a refactor request, you can choose only to publish to this group, and only people in this group can take bounties (or you can choose to label your code with a particular license to prevent reuse).
It would also help if you can provide a feature that the initiator can force the refactor to provide a mini document to explain why the refactored code is better.