discourse/discourse — pull request #881 by novemberkilo (2013-05-22 20:05:01+00:00)
Title: Improve flog metric for Post#extract_quoted_post_numbers

This is my first attempt at contributing to Discourse. In order to familiarise myself with the project I have chosen to start out with some code cleanup/refactoring.

I've picked a class that receives an F on [Code Climate](https://codeclimate.com/github/discourse/discourse/Post#method-complexity) and picked a method that has a high complexity score - namely `Post#extract_quoted_post_numbers`

The following are the results of the changes in this PR:

| | Post | extract_quoted_post_numbers |
| ------------- | -------------:| -----:|
| flog score before | 569.4 | 40.4 |
| flog score after | 558.9 | 18.9 |

There isn't a significant improvement in the overall flog score of the class but the method shows an improvement.

Oh and tests pass locally :)

I look forward to feedback. If this sort of thing is of value, I am happy to continue with some more refactoring/cleanup for now.