Commit 32c9e7f
committed
refactor: Break down DiffStix class methods for better maintainability
Extracted complex logic from large methods into smaller, focused helper methods:
**load_data() improvements:**
- Extracted _detect_revocation() for revocation detection logic
- Extracted _detect_deprecation() for deprecation detection logic
- Extracted _categorize_version_change() for version change classification
- Extracted _process_description_changes() for description diff processing
- Extracted _process_relationship_changes() for relationship updates
- Reduced main loop complexity from 188 to 139 lines
**Relationship analysis improvements:**
- Created _collect_related_objects() to reduce duplication in relationship collection
- Created _create_changelog_entry() for standardized changelog structure creation
- Created _collect_detection_objects() to handle complex detection relationship logic
- find_technique_mitigation_changes(): 56 lines → 16 lines (71% reduction)
- find_technique_detection_changes(): 117 lines → 33 lines (72% reduction)
**Benefits:**
- Better separation of concerns with single-responsibility methods
- Improved code readability and maintainability
- Reduced duplication across relationship analysis methods
- Comprehensive docstrings for all new helper methods
- Maintains backward compatibility - no API changes1 parent fcc8708 commit 32c9e7f
1 file changed
Lines changed: 314 additions & 209 deletions
0 commit comments