Instructions: In this assignment, you will work on improving the quality of a provided codebase through static analysis and code review. The main objective is to identify and address code quality issues, potential bugs, and adherence to coding standards using a static analysis tool. You will document the issues you discover and describe how you fixed them.
Codebase:
You can find a simple Python codebase that calculates and displays the total price of items in a shopping cart on this repository: https://github.com/shoklah/ELU_SE_W31. The codebase consists of a single Python script named shopping_cart.py
. However, this script contains several issues related to code quality, potential bugs, and adherence to coding standards.
Tasks:
-
Static Analysis:
- Choose a Python static analysis tool (e.g.,
pylint
,flake8
,bandit
). - Run the chosen tool on the
shopping_cart.py
script to identify and document code quality issues, potential bugs, and deviations from coding standards.
- Choose a Python static analysis tool (e.g.,
-
Issue Resolution:
- Fix the issues identified by the static analysis tool in the codebase.
- Commit your changes with meaningful commit messages describing each fix.
-
Code Review:
- Review the fixed code to ensure that the identified issues have been adequately addressed.
- If you find any additional issues during your review, repeat the process of fixing and committing.
Submission Guidelines:
- Fork the provided GitHub repository and clone it to your local machine.
- Choose and run a static analysis tool on the
shopping_cart.py
script. - Fix the identified issues.
- Commit your changes with clear commit messages.
- If needed, repeat the issue resolution process after your review.
- Provide the link to your public forked repository with the fixed code.