Loading
Remove unused method Clusters::Cluster#platform_kubernetes_active?
Summary
Removes the unused method Clusters::Cluster#platform_kubernetes_active? from app/models/clusters/cluster.rb.
Verification
This method was verified as unused by:
-
keela --type methods(viascripts/lint/keela_baseline.yml) flagged it as unused - Grep search found no callers (
app/,lib/,ee/, views, JS/Vue, GraphQL, rake, config) - No metaprogramming patterns reference it (
send,public_send, symbol dispatch) - Not a Rails convention method (not an association, route, serializer, GraphQL, or policy method)
- Not a callback
Its sibling platform_kubernetes_rbac? (which is used) is left untouched, confirming this method is not part of a required interface.
Cascade Removals
None - this was a standalone removal. The method only referenced the platform_kubernetes association (used elsewhere) and active?, so nothing else became dead.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 374.9 | 369.2 | -5.7 (1.5%) |
| Method flog score | 5.7 | N/A | -5.7 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 2977.0 | 2922.8 | -54.2 (1.8%) |
| Spec block flog score | 54.2 | N/A | -54.2 removed |
Combined Flog Summary
| File | Flog Removed |
|---|---|
app/models/clusters/cluster.rb |
5.7 |
spec/models/clusters/cluster_spec.rb |
54.2 |
| Total | 59.9 |
Test Suite Impact
- Specs removed: 3 examples
- Spec file:
spec/models/clusters/cluster_spec.rb - Time saved per run: 1.05 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 4.38 hrs/month | $7.88 | $94.50 |
| Moderate | 30,000 | 8.75 hrs/month | $15.75 | $189.00 |
| Optimistic | 50,000 | 14.58 hrs/month | $26.25 | $315.00 |
Based on 1.05 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)
Files Modified
app/models/clusters/cluster.rb(method removed - 4 lines)spec/models/clusters/cluster_spec.rb(specs removed - 30 lines, 3 examples)scripts/lint/keela_baseline.yml(entry removed)scripts/lint/potential_methods_to_remove.yml(entry removed)
Related
- Part of dead code cleanup effort
- Method was listed in
scripts/lint/potential_methods_to_remove.yml