163 implement alternative strategy in meal plan generator#169
Conversation
… interactor. Now will have to give the user such option in the view.
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
checkstyle
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'mealPlanInputData' declaration and its first usage is 18, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'mealPlanInputData' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'mealPlanInputData' declaration and its first usage is 31, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'mealPlanInputData' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck> reported by reviewdog 🐶
NCSS for this method is 58 (max allowed is 50).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck> reported by reviewdog 🐶
Executable statement count is 50 (max allowed is 30).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'mealPlanInputData' declaration and its first usage is 31, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'mealPlanInputData' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'ingredients' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nutritionalInfo1' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nutritionalInfo2' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nutritionalInfo3' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nutritionalInfo4' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe1' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe2' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe3' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe4' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'likedRecipes' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'expectedNames' declaration and its first usage is 8, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'expectedNames' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'expectedImages' declaration and its first usage is 8, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'expectedImages' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'expectedIngredients' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nestedIngredients' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'expectedNutritionalInfo' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck> reported by reviewdog 🐶
Name 'use_case.meal_plan' must match pattern '^[a-z]+(.[a-zA-Z_]\w*)*$'.
| // Create DAO and user for the purposes of the test | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| // Create DAO and user for the purposes of the test, api key doesn't matter | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject("a"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
| // Temp DAO for testing, api key doesn't matter | ||
| FakeRecipeDAO fakeDAO = new FakeRecipeDAO(); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject("a"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
| FakeRecipeDAO fakeDAO = new FakeRecipeDAO(); | ||
| fakeDAO.recipesToReturn = new ArrayList<>(); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject("a"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
| FakeRecipeDAO fakeDAO = new FakeRecipeDAO(); | ||
| fakeDAO.exceptionToThrow = new RuntimeException("Simulated API failure"); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject("a"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
| FakeRecipeDAO fakeDAO = new FakeRecipeDAO(); | ||
| fakeDAO.recipesToReturn = null; // ← key difference | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(""); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'userRepository' should be declared final.
| MealPlanInputData inputData4 = new MealPlanInputData("1", "2", "3", "-1"); | ||
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| MealPlanInputData inputData1 = new MealPlanInputData("-1", "1", "2", "3", "default"); | ||
| MealPlanInputData inputData2 = new MealPlanInputData("1", "-1", "2", "3", "default"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'inputData2' should be declared final.
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| MealPlanInputData inputData1 = new MealPlanInputData("-1", "1", "2", "3", "default"); | ||
| MealPlanInputData inputData2 = new MealPlanInputData("1", "-1", "2", "3", "default"); | ||
| MealPlanInputData inputData3 = new MealPlanInputData("1", "2", "-1", "3", "default"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'inputData3' declaration and its first usage is 8, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
| InMemoryUserDataAccessObject userRepository = new InMemoryUserDataAccessObject(); | ||
| MealPlanInputData inputData1 = new MealPlanInputData("-1", "1", "2", "3", "default"); | ||
| MealPlanInputData inputData2 = new MealPlanInputData("1", "-1", "2", "3", "default"); | ||
| MealPlanInputData inputData3 = new MealPlanInputData("1", "2", "-1", "3", "default"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'inputData3' should be declared final.
| MealPlanInputData inputData1 = new MealPlanInputData("-1", "1", "2", "3", "default"); | ||
| MealPlanInputData inputData2 = new MealPlanInputData("1", "-1", "2", "3", "default"); | ||
| MealPlanInputData inputData3 = new MealPlanInputData("1", "2", "-1", "3", "default"); | ||
| MealPlanInputData inputData4 = new MealPlanInputData("1", "2", "3", "-1", "default"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'inputData4' declaration and its first usage is 9, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
| MealPlanInputData inputData1 = new MealPlanInputData("-1", "1", "2", "3", "default"); | ||
| MealPlanInputData inputData2 = new MealPlanInputData("1", "-1", "2", "3", "default"); | ||
| MealPlanInputData inputData3 = new MealPlanInputData("1", "2", "-1", "3", "default"); | ||
| MealPlanInputData inputData4 = new MealPlanInputData("1", "2", "3", "-1", "default"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'inputData4' should be declared final.
Implemented an alternative strategy for meal plan generator