Remove unused scope PoolRepository.by_source_project

Summary

Removes the unused scope PoolRepository.by_source_project from app/models/pool_repository.rb.

Related to #542966 (closed)

Verification

This scope was verified as unused by:

  • keela --type scopes flagged it as unused
  • Grep search found no callers (the finder's by_source_project_id is an unrelated _id-suffixed private method)
  • Not used in scope chaining
  • Not used in merge() calls
  • Not used as default_scope or association scope (EE mixin only adds a delegate)

Cascade Removals

None - this was a standalone removal.

The scope's only usage was a single spec example, so that describe '.by_source_project' block was removed along with its now-orphaned lets (another_pool_repository / project2).

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 134.0 131.3 -2.7 (2.0%)
Scope flog score 2.6 N/A -2.6 removed

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total 747.6 717.5 -30.1 (4.0%)
Spec block flog score 10.2 N/A -10.2 removed

Test Suite Impact

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

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 0.23 hrs/month $0.41 $4.91
Moderate 30,000 0.45 hrs/month $0.82 $9.82
Optimistic 50,000 0.76 hrs/month $1.36 $16.37

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

Files Modified

  • app/models/pool_repository.rb (scope removed - 1 line)
  • spec/models/pool_repository_spec.rb (specs removed - 16 lines, 1 example)
  • scripts/lint/keela_baseline.yml (entry removed - 2 lines)
  • Related to #542966 (closed) (Improve unused helper methods workflow)
  • Part of dead code cleanup effort
  • Scope was listed in scripts/lint/keela_baseline.yml

Merge request reports

Loading
Loading