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

refactor: resolve eslint warnings (max-statements, complexity) #1486

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

btlghrants
Copy link
Collaborator

Description

Refactor to eliminate eslint warnings: max-statements, complexity in src/lib/controller/index.ts.

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)
  • Other (security config, docs update, etc)

Checklist before merging

@btlghrants btlghrants self-assigned this Nov 22, 2024
@btlghrants btlghrants added this to the v0.41.0 milestone Nov 22, 2024
@btlghrants btlghrants marked this pull request as ready for review November 22, 2024 21:57
@btlghrants btlghrants requested a review from a team as a code owner November 22, 2024 21:57
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 79.17%. Comparing base (847ec6e) to head (0104d02).

Files with missing lines Patch % Lines
src/lib/controller/index.ts 6.25% 15 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1486      +/-   ##
==========================================
+ Coverage   78.56%   79.17%   +0.60%     
==========================================
  Files          38       39       +1     
  Lines        1717     1719       +2     
  Branches      410      388      -22     
==========================================
+ Hits         1349     1361      +12     
- Misses        339      356      +17     
+ Partials       29        2      -27     
Files with missing lines Coverage Δ
src/lib/controller/index.util.ts 100.00% <100.00%> (ø)
src/lib/controller/index.ts 10.83% <6.25%> (+1.53%) ⬆️

... and 6 files with indirect coverage changes

---- 🚨 Try these New Features:

@btlghrants
Copy link
Collaborator Author

The controller index file didn't have direct unit test coverage before I started refactoring it, but I did what I could: I added tests around the lines I had to move to cut the complexity rating, but tried not to touch anything else.

The file's still failing short of the 78.xx% codecov goal but I got it from 0% to 40-something% and I think this is probably the best place to stop (for now). Doing more is going to require some non-trivial rework and that feels a bit out of scope for the thread I'm currently pulling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

1 participant