Remove unused method Ci::Tag.find_or_create_with_like_by_name

Summary

Removes the unused method Ci::Tag.find_or_create_with_like_by_name from app/models/ci/tag.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, its spec, and the keela baseline referenced it)
  • No metaprogramming patterns reference it (no send/public_send/method() construction)
  • Not a Rails convention method (Ci::Tag < Ci::ApplicationRecord, a GitLab class — not the acts-as-taggable gem interface)
  • Not a callback

Cascade Removals

None - this was a standalone removal. The delegate target find_or_create_all_with_like_by_name remains in use by Ci::PendingBuild and Ci::Taggable.

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 42.7 40.5 -2.2 (5.2%)
Method flog score 2.2 N/A -2.2 removed

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total 360.2 289.4 -70.8 (19.7%)
Spec block flog score 70.9 N/A -70.9 removed

Combined Flog Summary

File Flog Removed
app/models/ci/tag.rb 2.2
spec/models/ci/tag_spec.rb 70.9
Total 73.1

Test Suite Impact

  • Specs removed: 4 examples
  • Spec file: spec/models/ci/tag_spec.rb
  • Time saved per run: 0.43 seconds

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 1.81 hrs/month $3.25 $39.04
Moderate 30,000 3.62 hrs/month $6.51 $78.09
Optimistic 50,000 6.03 hrs/month $10.85 $130.15

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

Files Modified

  • app/models/ci/tag.rb (method removed - 4 lines)
  • spec/models/ci/tag_spec.rb (specs removed - 31 lines, 4 examples)
  • scripts/lint/keela_baseline.yml (entry removed - 2 lines)
  • 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