discourse/discourse — pull request #910 by novemberkilo (2013-05-28 14:51:44+00:00)
Title: WIP - Reduce complexity of Post#raw_links

Working on reducing the complexity of the Post model, I picked the next most complex method - Post#raw_links. This PR reduces the complexity of this method from 27 to 14.

I think we need to break Post up and would like some feedback on the approach. I have extracted some methods that pertain to analysing links, hosts and mentions in a post object and placed them in a module. Thus far this seems a bit meh but I'm happy to pursue this further and clean up the methods in the module if this extraction approach is acceptable.

If we are happy with the PostAnalyser module, I can continue to work on refactoring its contents in this or a subsequent PR.

Thanks.