spruhaN / nutrition_pal

1 stars 1 forks source link

Code Review Comments (James Irwin) #3

Open irwinj22 opened 4 months ago

irwinj22 commented 4 months ago

Overall, the code looks solid! However, I have a few suggestions for how it could be improved:

  1. File organization — I believe it would be beneficial to create folders to organize the different files (ie. /docs, /csv, /api)
  2. Endpoint organization — I think it would also be helpful to break down the different endpoints into their own files, instead of just one main.py (meals.py, goals.py, user.py, workouts.py, etc.)
  3. Variety of Exercise — As far I can tell, all of the exercises are weightlifting … maybe it would be a good idea to include other exercise that are not strictly weightlifting (such as running, swimming, biking)?
  4. Variety of Muscle — Adding to the last point (3), maybe it would be helpful to include cardiovascular muscles to account for these other types of exercise (ie, heart)?
  5. Pal Suggestions — As far as I understand, the application is supposed to be able to make suggestions to the user (per proposal: “Nutrient Pal should be able to suggest missing macros and reminders so that the user gets closer to the their goals”). However, I don’t see anything within the code that can do this yet .. maybe this is just something that has yet to be implemented?
  6. Consistent Commenting — Only some of the functions within main.py have comments describing their purpose … possibly it would make sense to expand this practice to all of the functions?
  7. Error catching — As far as I understand, there is no error-catching within the endpoint code … maybe it would be good to use try/except statements to catch errors and print error messages when they occur?
  8. Defining units — The units for User.height (cm, inches?) and User.weight (kg, pounds?) are not defined, which could be confusing for the user and other programmers.
  9. Inconsistent IDs — This is a really small thing, but I noticed that within muscle_group_rows.csv, there is no ID 5 or 6 … maybe that could be changed?
  10. ID Order — Another small thing, but the IDs for muscle_group_rows and exercise_rows listed totally are out of order … maybe that should be changed for readability?
  11. Unused variables — One more small thing: the variable “result” (lines 70, 136 within main.py) are not used, so maybe the creation of the variable is unnecessary?
  12. Long JSON file — I am very unfamiliar with JSON, but package-lock.json being 600 lines just seems really long to me … is there any way that file could be broken down into components? Once again, I am not good with JSON, so this may be an erroneous suggestion.