Refactor read-model event dispatch to reduce Handle complexity#1670
Conversation
Co-authored-by: StuartFerguson <[email protected]>
Handle complexity
|
@copilot can you review the codacy issue please |
I reviewed it on |
|
@copilot the issue has changed to Method ReadModelDomainEventHandler::Handle has a cyclomatic complexity of 11 (limit is 8) |
Co-authored-by: StuartFerguson <[email protected]>
Updated in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot code not building now |
Co-authored-by: StuartFerguson <[email protected]>
Fixed in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot still failin to build |
Co-authored-by: StuartFerguson <[email protected]>
Fixed in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
ReadModelDomainEventHandler.Handlehad grown into a 79-line switch-based dispatcher, exceeding the complexity threshold and making event routing harder to scan. This change keeps the dispatch behavior intact while breaking the routing into smaller, event-family-specific helpers.Dispatcher split by event family
Handleto a compact coordinator that delegates to focused private methods.Preserved multi-step event behavior
Focused regression coverage
Example of the new dispatch shape:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
f.feedz.io/usr/bin/dotnet dotnet test /home/REDACTED/work/TransactionProcessor/TransactionProcessor/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj --filter VerifyBootstrapperIsValid --no-restore -nologo(dns block)/usr/bin/dotnet dotnet test /home/REDACTED/work/TransactionProcessor/TransactionProcessor/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj --filter EstateDomainEventHandler|MerchantScheduleDomainEventHandler|ContractDomainEventHandler|OperatorDomainEventHandler -p:RestoreIgnoreFailedSources=true -nologo(dns block)/opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.