Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve eslint complexity warnings #1248

Open
samayer12 opened this issue Oct 9, 2024 · 0 comments
Open

Resolve eslint complexity warnings #1248

samayer12 opened this issue Oct 9, 2024 · 0 comments
Labels

Comments

@samayer12
Copy link
Collaborator

samayer12 commented Oct 9, 2024

Describe what should be investigated or refactored

ESlint has several warnings for complexity violations across the codebase. Resolve these warnings.

This is a large issue that will require multiple PRs to address. Contributors are welcome to open up a smaller, targeted issue and resolve a single complexity warning to keep the size of work to a smaller chunk. We'll use cross-references to this issue to correlate changes.

Definition of Done

  • There are zero eslint warnings for complexity
  • complexity is set to error from warn in .eslintrc.json

Additional context

Run the linter with npm format:check

@samayer12 samayer12 added tech-debt good first issue Good for newcomers labels Oct 9, 2024
@cmwylie19 cmwylie19 removed the good first issue Good for newcomers label Oct 21, 2024
@cmwylie19 cmwylie19 added this to the v0.39.0 milestone Oct 23, 2024
@samayer12 samayer12 self-assigned this Oct 24, 2024
btlghrants pushed a commit that referenced this issue Oct 30, 2024
…1333)

## Description

This PR is part of the effort to reduce complexity in the code. Instead
of using ternaries that are chained together, this refactor introduces a
[FilterChain](https://docs.spring.io/spring-security/reference/servlet/architecture.html#servlet-filterchainproxy)
analagous to what you might see in the Spring Framework to achieve the
same outcome, improving readability and maintenance.

## Related Issue

Relates to #1248 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Co-authored-by: Case Wylie <cmwylie19@defenseunicorns.com>
@cmwylie19 cmwylie19 added the large large label Nov 4, 2024
@btlghrants btlghrants removed this from the v0.39.0 milestone Nov 4, 2024
cmwylie19 pushed a commit that referenced this issue Nov 6, 2024
## Description

Reverts filter-chaining from #1333 due to regressions, but keeps
subsequent work.

End to End Test:  <!-- if applicable -->  
(See [Pepr Excellent
Examples](https://github.com/defenseunicorns/pepr-excellent-examples))

## Related Issue

Relates to #1248 
Closes #1389 

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🏗 In progress
Development

No branches or pull requests

3 participants