Tbh, I am not very good in actually understanding code from open source projects. It seems to iterate through a graph beginning with @k00b - that makes sense
But the creation of the graph via sql is black magic to me: discounted by time logarithmic, then just building the sum means no penalty for lots of low-upvote comments (?)