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

Conversation

5 participants
@novemberkilo
Contributor

novemberkilo commented May 22, 2013

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

This comment has been minimized.

Show comment
Hide comment
@discoursebot

discoursebot May 22, 2013

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

discoursebot commented May 22, 2013

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

@eviltrout

This comment has been minimized.

Show comment
Hide comment
@eviltrout

eviltrout May 22, 2013

Member

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 ?

Member

eviltrout commented May 22, 2013

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

This comment has been minimized.

Show comment
Hide comment
@nlalonde

nlalonde May 23, 2013

Member

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

Member

nlalonde commented May 23, 2013

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

@SamSaffron

This comment has been minimized.

Show comment
Hide comment
@SamSaffron

SamSaffron May 23, 2013

Member

Yes, this is fine,

Thanks heaps

Member

SamSaffron commented May 23, 2013

Yes, this is fine,

Thanks heaps

SamSaffron added a commit that referenced this pull request May 23, 2013

Merge pull request #881 from novemberkilo/master
Improve flog metric for Post#extract_quoted_post_numbers

@SamSaffron SamSaffron merged commit 3dfc034 into discourse:master May 23, 2013

1 check failed

default The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment