Improve flog metric for Post#extract_quoted_post_numbers #881
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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:
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.