Remove unused scope Ci::Pipeline.not_ref_protected

Summary

Removes the unused scope Ci::Pipeline.not_ref_protected from app/models/ci/pipeline.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 (only the definition and its spec block referenced it)
  • Not used in scope chaining
  • Not used in merge() calls
  • Not used as default_scope, association scope, or via dynamic dispatch (send/public_send/string refs)

Note: Ci::Pipeline has no paired ref_protected scope. The ref_protected scopes that exist live on other models (Ci::PendingBuild, CommitStatus) and are unaffected by this removal.

Cascade Removals

None - this was a standalone removal.

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 2296.6 2292.4 -4.2 (0.2%)
Scope flog score 4.2 N/A -4.2 removed

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total 18785.9 18761.8 -24.1 (0.1%)
Spec block flog score 24.1 N/A -24.1 removed

Test Suite Impact

  • Specs removed: 1 example
  • Spec file: spec/models/ci/pipeline_spec.rb
  • Time saved per run: 0.041 seconds

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 0.17 hrs/month $0.31 $3.69
Moderate 30,000 0.34 hrs/month $0.61 $7.38
Optimistic 50,000 0.57 hrs/month $1.02 $12.30

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

Files Modified

  • app/models/ci/pipeline.rb (scope removed - 1 line)
  • spec/models/ci/pipeline_spec.rb (specs removed - 12 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