Remove unused ContainerExpirationPolicy.with_container_repositories

Summary

Removes the unused class method ContainerExpirationPolicy.with_container_repositories from app/models/container_expiration_policy.rb.

Related to #542966

Verification

This method was verified as unused by:

  • keela --type methods flagged it as unused
  • Grep search found no callers (app/, ee/, lib/, config/, views, .haml/.erb/.rake)
  • No metaprogramming patterns reference it (send/public_send/symbol dispatch)
  • Not a Rails convention method
  • Not a callback

The similarly-named sibling .without_container_repositories is still in use (by ContainerExpirationPolicyWorker) and is intentionally left untouched.

Cascade Removals

None - this was a standalone removal.

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 99.5 95.5 -4.0 (4.0%)
Method flog score 4.0 N/A -4.0 removed

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total 497.0 479.8 -17.2 (3.5%)
Spec block flog score 17.2 N/A -17.2 removed

Combined Flog Summary

File Flog Removed
app/models/container_expiration_policy.rb 4.0
spec/models/container_expiration_policy_spec.rb 17.2
Total 21.2

Test Suite Impact

  • Specs removed: 1 example
  • Spec file: spec/models/container_expiration_policy_spec.rb
  • Time saved per run: 0.04 seconds

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 0.17 hrs/month $0.30 $3.60
Moderate 30,000 0.33 hrs/month $0.60 $7.20
Optimistic 50,000 0.56 hrs/month $1.00 $12.00

Based on 0.04 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)

Files Modified

  • app/models/container_expiration_policy.rb (method removed - 9 lines)
  • spec/models/container_expiration_policy_spec.rb (specs removed - 5 lines, 1 example)
  • scripts/lint/keela_baseline.yml (entry removed)
  • Related to #542966 (Improve unused helper methods workflow)
  • Part of dead code cleanup effort
  • Method was listed in scripts/lint/keela_baseline.yml

Merge request reports

Loading
Loading