Remove unused method Ci::Runner#belongs_to_one_project?

Summary

Removes the unused method Ci::Runner#belongs_to_one_project? from app/models/ci/runner.rb.

Related to #542966

Verification

This method was verified as unused by:

  • keela --type methods flagged it as unused
  • Grep search found no callers (only the definition + one spec describe block reference it across app/, lib/, ee/, spec/, ee/spec/, config, and templates)
  • No metaprogramming patterns reference it (send/public_send/try/:belongs_to_one_project? symbol — none found)
  • Not a Rails convention method
  • Not a callback (no before_*/after_*/around_* registration references it); no EE override (ee/) or frontend belongsToOneProject usage

The sibling method belongs_to_more_than_one_project? is a distinct method that remains in use and is untouched.

Cascade Removals

None - this was a standalone removal.

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 772.1 769.7 -2.4 (0.3%)
Method flog score 2.4 N/A -2.4 removed

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total 7049.9 7018.5 -31.4 (0.4%)
Spec block flog score 31.4 N/A -31.4 removed

Combined Flog Summary

File Flog Removed
app/models/ci/runner.rb 2.4
spec/models/ci/runner_spec.rb 31.4
Total 33.8

Test Suite Impact

  • Specs removed: 2 examples
  • Spec file: spec/models/ci/runner_spec.rb
  • Time saved per run: 0.09 seconds

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 0.38 hrs/month $0.69 $8.26
Moderate 30,000 0.76 hrs/month $1.38 $16.52
Optimistic 50,000 1.27 hrs/month $2.29 $27.53

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

Files Modified

  • app/models/ci/runner.rb (method removed - 4 lines)
  • spec/models/ci/runner_spec.rb (specs removed - 16 lines, 2 examples)
  • scripts/lint/keela_baseline.yml (entry removed - 1 line)
  • 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