apiology/quality — pull request #7 by andyw8 (2014-07-12 15:30:36+00:00)
Title: Reduce dependency injection

I noticed that one of the Reek warnings was concerning a high number (13) of instance variables in `QualityChecker`.

Looking into this, I see that dependency injection is being used in order to stub methods during testing.

With Ruby's runtime flexibility, we can actually stub or set expectations on directly on the real classes. I've illustrated this for just `count_file` in this PR but there are several other variables this could apply to. This would help to improve the QualityChecker class by reducing the number of instance variables, simplifying the initializer, and reducing the amount of indirection.

I realise that there are other reasons for using Dependency Injection than just for testing. But since these File is a core Ruby class, it seems unlikely this would ever need to change.

What do you think?