You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, for student reasons I have looked for parts of your code where there may code smells and refactoring techniques can be applied.
In the CartItem and Cart classes you might get the stink of Inappropriate Intimacy because the getTotalPrice method is implemented in Cart but uses mostly information from CartItem
To fix this bad smell you can apply the move method technique with it the getTotalPrice method you could work directly in CartItem with the price of the Item and the amount it has.
Here is an example of a possible implementation:
The text was updated successfully, but these errors were encountered:
carana08
changed the title
Smell Code and Refactoring
Code Smell and Refactoring
Aug 12, 2023
Hello, for student reasons I have looked for parts of your code where there may code smells and refactoring techniques can be applied.
In the CartItem and Cart classes you might get the stink of Inappropriate Intimacy because the getTotalPrice method is implemented in Cart but uses mostly information from CartItem
restaurant-management-system/src/restaurantsystem/model/Cart.java
Lines 36 to 43 in 34a5024
To fix this bad smell you can apply the move method technique with it the getTotalPrice method you could work directly in CartItem with the price of the Item and the amount it has.
Here is an example of a possible implementation:
The text was updated successfully, but these errors were encountered: