feat: mark orphan runners before removing them #4001
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.10 (8.59 -> 8.50)
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Large Method scale-down.test.ts: 'for %s'.'For %s runners.' 🔥
- Complex Method runners.ts: getRunnerInfo 🔥
- Complex Method runners.ts: constructFilters 🔥
✅ Improving Code Health:
- Overall Code Complexity runners.ts 🔥
Annotations
Check warning on line 93 in lambdas/functions/control-plane/src/aws/runners.ts
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
getRunnerInfo increases in cyclomatic complexity from 13 to 15, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check warning on line 53 in lambdas/functions/control-plane/src/aws/runners.ts
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
constructFilters has a cyclomatic complexity of 9, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 1 in lambdas/functions/control-plane/src/aws/runners.ts
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.91 to 4.83, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
Check warning on line 448 in lambdas/functions/control-plane/src/scale-runners/scale-down.test.ts
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
'for %s'.'For %s runners.' increases from 154 to 192 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.