-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Rule: Function/Class Removal Detection
Overview
Identifies when functions, classes, or major code blocks are removed (not just refactored).
Label Metadata
- Label Name:
function-removed - Color:
fbca04(Yellow) - Description: Functions or classes removed from codebase
Detection Logic
Analyze diff for removal of code structures:
Patterns to detect:
- Function removals:
-function,-def,-fn - Class removals:
-class,-struct - Export removals:
-export function,-export class - File deletions with substantial code
Heuristics
- High ratio of deletions vs additions (>70% deletions)
- Function/class definitions removed (not moved)
- Multiple removals detected
Example Code That Triggers
- function deprecatedFunction() {
- // entire function removed
- }
-
- class OldComponent {
- // entire class removed
- }Example Code That Does NOT Trigger
- Function refactored (moved/renamed)
- Code refactored (same functionality)
- Small code cleanup
Test Cases Needed
- Detects function removals
- Detects class removals
- Detects export removals
- Handles file deletions
- Distinguishes from refactoring (rename)
- Ignores small code cleanup
Edge Cases
- Function extracted (moved) vs removed
- Deprecated functions (should still trigger)
- Temporary code removal for refactoring
Integration Notes
- Important for tracking breaking changes
- May want to combine with changelog generation
- Consider relationship with
refactorrule
Priority
Medium - Important for change tracking
Status: Not implemented
Category: Logic, Refactor & Naming
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels