Home - reidev275/SignsYouShouldProbablyRefactor GitHub Wiki
A list of signs that you should probably refactor. This list is in no particular order and is designed to be somewhat controversial. Are there times when breaking one or more of these is warranted? Sure, that's why the title is "Signs you should probably refactor". This list is simply codification of thoughts that go through my head as I write, refactor, and review code.
Method Construction
-
[You have abbreviated or ambiguous variable names] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-have-abbreviated-or-ambiguous-variable-names)
- You have a method that accepts more than 2 parameters
- [You are only using a portion of an argument's members] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-are-only-using-a-portion-of-an-argument's-members)
- You have a method or class with more than X lines of code
Solid Principals
- [You have an enum or a switch statement] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-have-an-enum-or-a-switch-statement)
- [You are using inheritance] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-are-using-inheritance)
- [You have public methods not implementing an interface] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-have-public-methods-not-implementing-an-interface)
-
[You have an instance variable used by few methods] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-have-an-instance-variable-used-by-few-methods)
-
You are using the "new" keyword
Encapsulation/Scope
- [You don't have null checks as the beginning of a public method] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-don't-have-null-checks-as-the-beginning-of-a-public-method)
- [You are calling a member of a member] (https://github.com/reidev275/SignsYouShouldProbablyRefactor/wiki/You-are-calling-a-member-of-a-member)
.NET specific
- You have a class that has to implement IDisposable