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
refactor: reduce cognitive complexity of _parse_processing_time
Code quality improvement:
- Extract nested parsing logic into separate helper methods
- Create _parse_hours_range() for range format (e.g., '4-8 hours')
- Create _parse_single_hours() for single hours format (e.g., '4 hours')
- Create _parse_minutes() for minutes format (e.g., '30 minutes')
- Simplify main function with early returns and method delegation
Benefits:
- Reduced cognitive complexity from 19 to ~8-10 (below 15 threshold)
- Improved readability and maintainability
- Easier to test individual parsing methods
- Better separation of concerns
All functionality preserved and tested.
0 commit comments