There are problems with ranking things based only on their total upvote count or only the ratio or positive to total votes. The best solution uses something called a Wilson Confidence Interval and the formula is in here.