defenseunicorns / pepr

Type safe K8s middleware for humans
https://pepr.dev
Apache License 2.0
212 stars 17 forks source link

Refactor complex implementation in `validate-processor.ts` #1381

Open samayer12 opened 3 weeks ago

samayer12 commented 3 weeks ago

Describe what should be investigated or refactored

Resolve the following linter warning: 15:8 warning Async function 'validateProcessor' has a complexity of 13. Maximum allowed is 10 complexity

Links to any relevant code

Check out src/lib/validate-processor.ts

Additional context

Related to #1248

samayer12 commented 3 weeks ago

validate-processor.ts is largely untested on main. We'll want to back-fill with some unit tests so that we can confidently refactor. This will provide a faster feedback loop instead of waiting for E2E tests to run.

File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
validate-processor.ts |   14.28 |        0 |       0 |   14.28 | 22-85
samayer12 commented 2 weeks ago

Unstarting this track of work in favor of v0.40.0 milestones.