Reduce buildProvider cyclomatic complexity - #6680
Merged
Merged
Conversation
Extract the JWT-bearer/ID-JAG factory construction and the device-flow factory construction into buildJWTBearerFactories and buildDeviceFlowFactory. This drops buildProvider's cyclomatic complexity from 16 to under the gocyclo threshold of 15 without changing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reyortiz3
requested review from
ChrisJBurns,
JAORMX,
jhrozek,
rdimitrov and
tgrunnagle
as code owners
September 17, 2026 16:20
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6680 +/- ##
==========================================
+ Coverage 79.14% 79.21% +0.06%
==========================================
Files 789 789
Lines 79021 79028 +7
==========================================
+ Hits 62545 62599 +54
+ Misses 16471 16424 -47
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aponcedeleonch
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainfailstask lintwith:buildProvideraccumulated branches over several recent additions (tokenexchange, JWT-bearer, ID-JAG, device flow), pushing it over the gocyclo
threshold. This PR restores a clean lint run without changing behavior:
buildJWTBearerFactorieshelper.buildDeviceFlowFactoryhelper.buildProvidernow calls these helpers and appends their results,bringing its cyclomatic complexity from 16 down to within the limit.
Type of change
Test plan
task test)task test-e2e)task lint-fix)task lintnow reports 0 issues, and the fulltask testsuite passes.Does this introduce a user-facing change?
No.
🤖 Generated with Claude Code