Remove unused method Ci::Runner#fallback_owner_project
Summary
Removes the unused method Ci::Runner#fallback_owner_project from app/models/ci/runner.rb.
Related to #542966 (closed)
Verification
This method was verified as unused by:
-
keela --type methodsflagged it as unused - Grep search found no callers (production, EE, lib, config, GraphQL, serializers, views)
- No metaprogramming patterns reference it (
:symbol,send,public_send,try) - Not a Rails convention method
- Not a callback
The only occurrence of the name outside the definition was a coincidentally-named let_it_be(:fallback_owner_project) Project fixture in spec/models/ci/runner_spec.rb, used by the #owner / assign_to tests. That fixture is not a call to this method. The runner ownership flow (Ci::Runner#owner) resolves the fallback project through the owner_runner_project association ordered by id, never through this method. The related assign_to specs (including "changes owner to fallback owner project") continue to pass after removal.
Cascade Removals
None - this was a standalone removal.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 772.3 | 763.4 | -8.9 (1.2%) |
| Method flog score | 9.0 | N/A | -9.0 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 7062.1 | 7062.1 | -0.0 (0%) |
| Spec block flog score | 0.0 | N/A | -0.0 removed |
No dedicated spec block existed for this method, so the spec file is unchanged.
Combined Flog Summary
| File | Flog Removed |
|---|---|
app/models/ci/runner.rb |
9.0 |
spec/models/ci/runner_spec.rb |
0.0 |
| Total | 9.0 + 0.0 |
Test Suite Impact
- Specs removed: 0 examples (no dedicated spec block for this method)
- Spec file:
spec/models/ci/runner_spec.rb(unchanged) - Time saved per run: 0.00 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 0.00 hrs/month | $0.00 | $0.00 |
| Moderate | 30,000 | 0.00 hrs/month | $0.00 | $0.00 |
| Optimistic | 50,000 | 0.00 hrs/month | $0.00 | $0.00 |
Based on 0.00 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes). This removal's value is code complexity reduction (flog -9.0), not spec time, because no spec exercised the method.
Files Modified
app/models/ci/runner.rb(method removed - 8 lines)scripts/lint/keela_baseline.yml(entry removed - 2 lines)
Related
- Related to #542966 (closed) (Improve unused helper methods workflow)
- Part of dead code cleanup effort
- Method was listed in
scripts/lint/keela_baseline.yml