Files
Tobias GesellchenandClaude Opus 4.7 59593a27e0 refactor(marge): extract findMatchingSourceForUpdatePreset to drop cyclo to spec
After adding the (SourceKeyType, SourceKeyAccount) tier to the storePreset
matcher, UpdatePreset's cyclomatic complexity climbed to 23 (gocyclo
threshold is 20). The three match tiers (ID → type+account → type-only
legacy) read more clearly as named branches in a helper anyway, so pull
them into findMatchingSourceForUpdatePreset and an isWellKnownProviderID
predicate. UpdatePreset now just parses, logs, calls the matcher, and
proceeds.

Also adds the doc comment revive was missing on UpdatePreset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 22:49:28 +02:00
..