Loading
Remove unused method UserMentionBehaviour#has_mentions?
Summary
Removes the unused method UserMentionBehaviour#has_mentions? from app/models/concerns/user_mention_behaviour.rb.
Related to #542966
Verification
This method was verified as unused by:
-
scripts/lint/unused_code.rb --type methodsflagged it as unused - Grep search found no callers
- No metaprogramming patterns reference it
- Not a Rails convention method
- Not a callback
Cascade Removals
None - this was a standalone removal.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 21.4 | 13.5 | -7.9 (37%) |
| Method flog score | 7.9 | N/A | -7.9 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 196.8 | 102.1 | -94.7 (48%) |
| Spec block flog score | 94.7 | N/A | -94.7 removed |
Combined Flog Summary
| File | Flog Removed |
|---|---|
app/models/concerns/user_mention_behaviour.rb |
7.9 |
spec/support/shared_examples/models/user_mentions_shared_examples.rb |
94.7 |
| Total | 102.6 |
Test Suite Impact
- Specs removed: 36 examples (4 examples × 9 spec files using shared example)
- Spec file:
spec/support/shared_examples/models/user_mentions_shared_examples.rb - Time saved per run: 1.08 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 4.5 hrs/month | $8.10 | $97.20 |
| Moderate | 30,000 | 9.0 hrs/month | $16.20 | $194.40 |
| Optimistic | 50,000 | 15.0 hrs/month | $27.00 | $324.00 |
Based on 1.08 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)
Files Modified
app/models/concerns/user_mention_behaviour.rb(method removed - 4 lines)spec/support/shared_examples/models/user_mentions_shared_examples.rb(specs removed - 37 lines, restructured remaining.for_notesscope tests)scripts/lint/potential_methods_to_remove.yml(entry removed)scripts/lint/keela_baseline.yml(entry removed)
Related
- Related to #542966 (Improve unused helper methods workflow)
- Part of dead code cleanup effort
- Method was listed in
scripts/lint/potential_methods_to_remove.yml