diff --git a/Code_Smells_Patterns.md b/Code_Smells_Patterns.md index 31fdc87..54d399f 100644 --- a/Code_Smells_Patterns.md +++ b/Code_Smells_Patterns.md @@ -4,19 +4,19 @@ **Duplicated Code** -Force: Refactoring may be considered if a common structure is recongized among related methods. +* Force: Refactoring may be considered if a common structure is recongized among related methods. -Solution: It may be possible to generalize smaller methods to allow them to work as one. However, you must be careful to not over generalize a method and allow it to have more power than nessecary. A good metric to measure by is that a method should have between 6-9 meaningful lines of code. +* Solution: It may be possible to generalize smaller methods to allow them to work as one. However, you must be careful to not over generalize a method and allow it to have more power than nessecary. A good metric to measure by is that a method should have between 6-9 meaningful lines of code. **Excessive Conditionals** -Force: Refactoring may be considered if a section of code seems overloaded with conditional statements or switch cases +* Force: Refactoring may be considered if a section of code seems overloaded with conditional statements or switch cases -Solution: It may be possible to break these conditionals up into smaller, more conscise methods that are easier to read and have a clear purpose. +* Solution: It may be possible to break these conditionals up into smaller, more conscise methods that are easier to read and have a clear purpose. **Reocurring Parameter lists** -Force: Refactoring may be considered if a certian list of parameters keeps reappearing in many methods. +* Force: Refactoring may be considered if a certian list of parameters keeps reappearing in many methods. For example: ``` function(int a, int b, string c) @@ -24,4 +24,4 @@ function2(int a, int b, string c) function3(int a, int b, string c) ``` -Solution: It may be possible to group these parameters into an object and instead pass the object around to different functions rather than passing each parameter. \ No newline at end of file +* Solution: It may be possible to group these parameters into an object and instead pass the object around to different functions rather than passing each parameter. \ No newline at end of file