Loading
Remove unused scope Packages::Npm::Metadatum.package_id_in
Summary
Removes the unused scope Packages::Npm::Metadatum.package_id_in from app/models/packages/npm/metadatum.rb.
scope :package_id_in, ->(package_ids) { where(package_id: package_ids) }Verification
This scope was verified as unused by:
-
keela --type scopesflagged it as unused (live report +scripts/lint/keela_baseline.yml) - Grep search found no callers (
app/,lib/,ee/, config, views, GraphQL) - Not used in scope chaining
- Not used in
merge()calls - Not used as
default_scopeor association scope - No symbol/string references (
:package_id_in,'package_id_in') or dynamic dispatch (send,public_send,try)
Cascade Removals
None - this was a standalone removal. It is a simple leaf where scope; removing it left no other code dead.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 17.4 | 15.4 | -2.0 (11.5%) |
| Scope flog score | ~2.0 | N/A | -2.0 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 191.9 | 164.8 | -27.1 (14.1%) |
| Spec block flog score | 27.1 | N/A | -27.1 removed |
Test Suite Impact
- Specs removed: 1 example
- Spec file:
spec/models/packages/npm/metadatum_spec.rb - Time saved per run: ~0.03 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 0.12 hrs/month | $0.22 | $2.70 |
| Moderate | 30,000 | 0.25 hrs/month | $0.45 | $5.40 |
| Optimistic | 50,000 | 0.42 hrs/month | $0.75 | $9.00 |
Based on 0.03 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)
Files Modified
app/models/packages/npm/metadatum.rb(scope removed - 2 lines)spec/models/packages/npm/metadatum_spec.rb(specs removed - 12 lines, 1 example)scripts/lint/keela_baseline.yml(entry removed)scripts/lint/potential_scopes_to_remove.yml(entry removed)
Related
- Part of dead code cleanup effort
- Scope was listed in
scripts/lint/potential_scopes_to_remove.yml
Edited by Kerri Miller