Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve flog metric for Post#extract_quoted_post_numbers #881

Merged
merged 2 commits into from
May 23, 2013
Merged

Improve flog metric for Post#extract_quoted_post_numbers #881

merged 2 commits into from
May 23, 2013

Conversation

novemberkilo
Copy link
Contributor

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:

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.

@discoursebot
Copy link

Thanks for contributing this pull request! Could you please sign our CLA so we can review it? http://www.discourse.org/cla

@eviltrout
Copy link
Contributor

We do have a rule that we don't accept "style only" changes, but I think this case is something different as it's closer to refactoring to reduce complexity.

Anything that makes our code base easier to follow and update is fine by me.

Thoughts @SamSaffron @coding-horror and @nlalonde ?

@nlalonde
Copy link
Member

I agree, it's an improvement. Thanks for contributing!

@SamSaffron
Copy link
Member

Yes, this is fine,

Thanks heaps

SamSaffron added a commit that referenced this pull request May 23, 2013
Improve flog metric for Post#extract_quoted_post_numbers
@SamSaffron SamSaffron merged commit 3dfc034 into discourse:master May 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants