naught icon indicating copy to clipboard operation
naught copied to clipboard

Refactor NullClassBuilder#generate_class

Open padi opened this issue 11 years ago • 7 comments

Seems that this can be refactored further.

padi avatar Jun 26 '13 17:06 padi

Coverage Status

Coverage remained the same when pulling 5525994b795d255696f0c4bc6cab36afa65c1b9d on padi:initialize_base_class into 0869d4a8d4b304ae18e68789d03baacbfb32be2a on avdi:master.

coveralls avatar Jun 26 '13 17:06 coveralls

This patch no longer applies cleanly to master. If you’re still interested in having it be applied, can you please rebase from master?

sferik avatar Jan 26 '14 12:01 sferik

@sferik sure. I'll look at it tomorrow and see if it still makes sense to apply this patch.

padi avatar Jan 26 '14 15:01 padi

@sferik oops. I still don't know anything about Rubocop, so I guess I'll just continue it tomorrow. The rspec tests pass though.

Edit: I get it now. The NullBuilderClass has 147 out of 144 allowable number of lines (enforced by rubocop.yml). Should I try to shorten the number of non-empty lines or should I increase the class lines to 147? Perhaps applying Replace Method w/ Method Object on the new method initialize_base_class?

padi avatar Jan 26 '14 16:01 padi

@padi If you can find a way to refactor further that doesn’t increase the length of the class, that would be great. Otherwise, I think it’s okay to increase the RuboCop limit to 147 (or an even 150).

sferik avatar Jan 27 '14 03:01 sferik

@sferik it's ok now. Let me know what you think.

padi avatar Jan 28 '14 00:01 padi

@padi I know I suggested refactoring to cut down the length of the NullClassBuilder class but it seems a bit excessive to have a class whose sole purpose is initializing another class.

@avdi Curious to get your thoughts on this.

sferik avatar Jan 28 '14 01:01 sferik