Repository navigation
refactor(common,registry,controller,cni): reduce cognitive complexity to <=15 (part of #556) - #560
Merged
Merged
Conversation
… to <=15 (part of #556) Extract nested blocks to named helpers across 11 files to bring all non-test functions in scope to gocognit <=15. Zero behavior change: identical error strings, log messages, and event-handling order. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
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
Reduces gocognit cognitive complexity to ≤15 for all non-test functions in scope (Lane 6 of #556). Structure-only refactor — zero behavior change.
Per-function extraction summary
ValidateSpeccommon/extensionfilter/extensionfilter.govalidateFormCount,validateScope,validateTypedForms,validateRBACForm,validateRBACPolicy,validateOpaqueFormRendercommon/extensionfilter/extensionfilter.gorenderRBACPerRoute,renderExtAuthzPerRoute,renderHeaderToMetadataProjectHTTPRulecommon/gammaproject/project.gohttpRouteTimeout,projectHTTPMatches,collectHTTPExtensionFiltersProjectGRPCRulecommon/gammaproject/project.goprojectGRPCMatches,applyGRPCMethodMatch,collectGRPCExtensionFilters(*Server).Startcommon/xds/server.golistenAtomicWriteReadercommon/file/file.gojoinErrors(*DynamoDBRegistry).ListAllEndpointsregistry/internal/ddb/dynamodb.gocollectPageEndpoints(*RegistrarRegistry).processStreamregistry/internal/registrar/registrar.gohandleStreamError,handleCatalogEvent(*Validator).checkChainConflictcontroller/internal/httpfilter/webhook.gochainTargetServices,findChainConflict(*CABundleInjector).injectcontroller/internal/meshconfig/cabundle.goinjectValidating,injectMutatingpodExcludedOutboundIPRangescni/internal/plugin/plugin.goparseIPv4RangeEntrygetCNIConfigFilepathcni/internal/install/cniconfig.goresolveConfName,waitForConfigFileBuildOutboundServiceVirtualHostagent/internal/xds/proxy/route.gobuildScoredRoutes(+scoredRoutetype promoted to package level)Verification
$BIN -over 15 <all scope dirs>excluding_test.go→ empty outputmake gazelle && make formatcleanPart of #556
🤖 Generated with Claude Code
https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR