Loading
Remove unused delegations distribution_codename and distribution_suite
Summary
Removes the unused delegations Packages::Debian::Package#distribution_codename and Packages::Debian::Package#distribution_suite from app/models/packages/debian/package.rb. Both are generated by a single delegate :codename, :suite, to: :distribution, prefix: :distribution line, which is removed in full.
Related to #542966 (closed)
Verification
These delegated methods were verified as unused by:
-
keela --type delegationsflagged both generated methods as unused - Repository-wide
rgsearch fordistribution_codename/distribution_suitefound no callers outside the keela baseline - No metaprogramming patterns reference them (no
send/public_send, no:distribution_*symbols) - Not a Rails convention method
- Not a callback, and no EE mixin reopens
Packages::Debian::Package
Cascade Removals
None - this was a standalone removal.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 53.0 | 52.0 | -1.0 (1.9%) |
| Delegation flog score | 1.0 | N/A | -1.0 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 504.5 | 482.4 | -22.1 (4.4%) |
| Spec block flog score | 22.1 | N/A | -22.1 removed |
Combined Flog Summary
| File | Flog Removed |
|---|---|
app/models/packages/debian/package.rb |
1.0 |
spec/models/packages/debian/package_spec.rb |
22.1 |
| Total | 1.0 + 22.1 = 23.1 |
Test Suite Impact
- Specs removed: 2 examples (the delegation-only
describe 'delegates'block) - Spec file:
spec/models/packages/debian/package_spec.rb - Time saved per run: 0.03887 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 0.16 hrs/month | $0.29 | $3.50 |
| Moderate | 30,000 | 0.32 hrs/month | $0.58 | $7.00 |
| Optimistic | 50,000 | 0.54 hrs/month | $0.97 | $11.66 |
Based on 0.03887 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)
Files Modified
app/models/packages/debian/package.rb(delegation removed - 2 lines)spec/models/packages/debian/package_spec.rb(specs removed - 5 lines, 2 examples)scripts/lint/keela_baseline.yml(2 entries removed - 3 lines)
Related
- Related to #542966 (closed) (Improve unused helper methods workflow)
- Part of dead code cleanup effort
- Delegations were listed in
scripts/lint/keela_baseline.yml