Completed Lab 5 assignment on Static Code Analysis using Pylint, Flake8, and Bandit.
inventory_system.py- Fixed and optimized inventory management systemLab5- Lab instructions
- Pylint - Code quality analysis
- Flake8 - PEP 8 style enforcement
- Bandit - Security vulnerability scanning
pip install pylint flake8 banditpylint inventory_system.py
flake8 inventory_system.py
bandit inventory_system.pypython inventory_system.py| Tool | Before | After |
|---|---|---|
| Pylint | 4.80/10 | 10.00/10 ✅ |
| Flake8 | 11 issues | 0 issues ✅ |
| Bandit | 2 vulnerabilities | 0 vulnerabilities ✅ |
- Added module and function docstrings
- Renamed functions to snake_case
- Fixed mutable default argument
- Used f-strings for formatting
- Specified exception types
- Used context managers for file operations
- Added encoding parameters
- Removed eval() (security vulnerability)
- Removed unused imports
- PEP 8 compliance
✅ COMPLETED - All static analysis tools report zero issues.