{"results":{"result":{"added-files":{"code-health":10.0,"old-code-health":0.0,"files":[{"file":"src/Paramore.Brighter/RequestContext.cs","loc":45,"old-loc":0,"code-health":10.0}]},"external-review-url":"https://github.com/BrighterCommand/Brighter/pull/3454","old-code-health":9.504858980610155,"modified-files":{"code-health":9.49389659182103,"old-code-health":9.504858980610155,"files":[{"file":"src/Paramore.Brighter/CommandProcessor.cs","loc":681,"old-loc":677,"code-health":8.283981080161325,"old-code-health":8.283981080161325},{"file":"src/Paramore.Brighter/PipelineBuilder.cs","loc":339,"old-loc":288,"code-health":7.788037646779413,"old-code-health":7.788037646779413},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_A_Handler_Is_Part_Of_An_Async_Pipeline.cs","loc":47,"old-loc":47,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_A_Handler_Is_Part_of_A_Pipeline.cs","loc":47,"old-loc":47,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Handler_For_A_Command.cs","loc":37,"old-loc":37,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Handler_For_An_Async_Command.cs","loc":38,"old-loc":38,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_Allow_ForiegnAttribues.cs","loc":47,"old-loc":47,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_Allow_Pre_And_Post_Tasks.cs","loc":47,"old-loc":47,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_Failures_Should_Be_ConfigurationErrors.cs","loc":30,"old-loc":30,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_Preserve_The_Order.cs","loc":46,"old-loc":46,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox.cs","loc":52,"old-loc":52,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox_And_NoInbox_Attribute.cs","loc":49,"old-loc":49,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox_And_NoInbox_Attribute_Async .cs","loc":49,"old-loc":49,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox_And_Use_Inbox.cs","loc":67,"old-loc":67,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox_And_Use_Inbox_Async.cs","loc":68,"old-loc":68,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox_Async.cs","loc":53,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Pipeline_With_Global_Inbox_Override_Context.cs","loc":53,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_A_Sync_Pipeline_That_Has_Async_Handlers.cs","loc":44,"old-loc":44,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_An_Async_Pipeline_Allow_ForiegnAttribues.cs","loc":45,"old-loc":45,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_An_Async_Pipeline_Allow_Pre_And_Post_Tasks.cs","loc":45,"old-loc":45,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_An_Async_Pipeline_Failures_Should_Be_ConfigurationErrors.cs","loc":30,"old-loc":30,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_An_Async_Pipeline_Preserve_The_Order.cs","loc":47,"old-loc":47,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Building_An_Async_Pipeline_That_Has_Sync_Handlers.cs","loc":42,"old-loc":42,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Finding_A_Hander_That_Has_Dependencies.cs","loc":40,"old-loc":40,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_Finding_A_Handler_For_A_Command.cs","loc":41,"old-loc":41,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Pipeline/When_We_Have_Exercised_The_Pipeline_Cleanup_Its_Handlers.cs","loc":62,"old-loc":62,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.Extensions.DependencyInjection/ServiceProviderHandlerFactory.cs","loc":57,"old-loc":38,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.ServiceActivator/Ports/ControlBusHandlerFactory.cs","loc":26,"old-loc":26,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/AsyncHandlerFactory.cs","loc":20,"old-loc":20,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/HandlerFactory.cs","loc":30,"old-loc":30,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/HandlerLifetimeScope.cs","loc":59,"old-loc":59,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/SimpleHandlerFactoryAsync.cs","loc":21,"old-loc":21,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/SimpleHandlerFactorySync.cs","loc":18,"old-loc":18,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.AWS.Tests/TestDoubles/QuickHandlerFactory.cs","loc":17,"old-loc":17,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.AWS.Tests/TestDoubles/QuickHandlerFactoryAsync.cs","loc":17,"old-loc":17,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Post/When_Posting_Fails_Limit_Total_Writes_To_OutBox_In_Window.cs","loc":93,"old-loc":93,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Post/When_Posting_With_A_Default_Policy.cs","loc":84,"old-loc":84,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/TestDoubles/QuickHandlerFactory.cs","loc":10,"old-loc":10,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/TestDoubles/QuickHandlerFactoryAsync.cs","loc":10,"old-loc":10,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.ServiceActivator.Control/Hosting/HeartbeatHostedService.cs","loc":35,"old-loc":37,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.ServiceActivator.Extensions.DependencyInjection/ServiceCollectionExtensions.cs","loc":53,"old-loc":62,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.ServiceActivator/ConsumerFactory.cs","loc":101,"old-loc":101,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Paramore.Brighter.ServiceActivator/ControlBus/ControlBusReceiverBuilder.cs","loc":175,"old-loc":176,"code-health":8.462305685268852,"old-code-health":8.457571302312836},{"file":"src/Paramore.Brighter.ServiceActivator/DispatchBuilder.cs","loc":119,"old-loc":119,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.ServiceActivator/Dispatcher.cs","loc":280,"old-loc":298,"code-health":8.679575849015766,"old-code-health":8.679575849015766},{"file":"src/Paramore.Brighter.ServiceActivator/MessagePump.cs","loc":57,"old-loc":62,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.ServiceActivator/Proactor.cs","loc":298,"old-loc":302,"code-health":8.228209496091461,"old-code-health":8.219040679463534},{"file":"src/Paramore.Brighter.ServiceActivator/Reactor.cs","loc":289,"old-loc":291,"code-health":8.228209496091461,"old-code-health":8.219040679463534},{"file":"tests/Paramore.Brighter.AWS.Tests/MessagingGateway/When_throwing_defer_action_respect_redrive.cs","loc":131,"old-loc":132,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.AWS.Tests/MessagingGateway/When_throwing_defer_action_respect_redrive_async.cs","loc":129,"old-loc":130,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/Call/When_Calling_A_Server_Via_The_Command_Processor.cs","loc":106,"old-loc":107,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_channel_failure_exception_is_thrown_for_command_should_retry_until_connection_re_established_async.cs","loc":63,"old-loc":64,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_channel_failure_exception_is_thrown_for_event_should_retry_until_connection_re_established_async.cs","loc":62,"old-loc":63,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_command_handler_throws_a_defer_message_Then_message_is_requeued_until_rejected_async.cs","loc":52,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_command_handler_throws_unhandled_exception_Then_message_is_acked_async.cs","loc":62,"old-loc":63,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_message_fails_to_be_mapped_to_a_request_and_the_unacceptable_message_limit_is_reached_async.cs","loc":52,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_message_fails_to_be_mapped_to_a_request_async.cs","loc":45,"old-loc":46,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_message_is_dispatched_it_should_reach_a_handler_async.cs","loc":51,"old-loc":52,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_requeue_count_threshold_for_commands_has_been_reached.cs","loc":56,"old-loc":57,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_requeue_count_threshold_for_events_has_been_reached.cs","loc":58,"old-loc":59,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_requeue_of_command_exception_is_thrown.cs","loc":57,"old-loc":58,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_a_requeue_of_event_exception_is_thrown.cs","loc":58,"old-loc":59,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_an_event_handler_throws_a_defer_message_Then_message_is_requeued_until_rejectedAsync.cs","loc":51,"old-loc":52,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_an_event_handler_throws_unhandled_exception_Then_message_is_acked_async.cs","loc":63,"old-loc":64,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_an_unacceptable_message_is_recieved_async.cs","loc":56,"old-loc":57,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_an_unacceptable_message_limit_is_reached_async.cs","loc":60,"old-loc":61,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_reading_a_message_from_a_channel_pump_out_to_command_processor_async.cs","loc":52,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Proactor/When_running_a_message_pump_on_a_thread_should_be_able_to_stop_async.cs","loc":57,"old-loc":58,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_channel_failure_exception_is_thrown_for_command_should_retry_until_connection_re_established.cs","loc":63,"old-loc":64,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_channel_failure_exception_is_thrown_for_event_should_retry_until_connection_re_established.cs","loc":62,"old-loc":63,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_command_handler_throws_a_defer_message_Then_message_is_requeued_until_rejected.cs","loc":49,"old-loc":50,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_command_handler_throws_unhandled_exception_Then_message_is_acked.cs","loc":59,"old-loc":60,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_message_fails_to_be_mapped_to_a_request.cs","loc":47,"old-loc":48,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_message_fails_to_be_mapped_to_a_request_and_the_unacceptable_message_limit_is_reached.cs","loc":49,"old-loc":50,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_message_is_dispatched_it_should_reach_a_handler.cs","loc":61,"old-loc":62,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_requeue_count_threshold_for_commands_has_been_reached.cs","loc":56,"old-loc":57,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_requeue_count_threshold_for_events_has_been_reached.cs","loc":58,"old-loc":59,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_requeue_of_command_exception_is_thrown.cs","loc":57,"old-loc":58,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_a_requeue_of_event_exception_is_thrown.cs","loc":58,"old-loc":59,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_an_event_handler_throws_a_defer_message_Then_message_is_requeued_until_rejected.cs","loc":56,"old-loc":57,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_an_event_handler_throws_unhandled_exception_Then_message_is_acked.cs","loc":68,"old-loc":69,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_an_unacceptable_message_is_recieved.cs","loc":53,"old-loc":54,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_an_unacceptable_message_limit_is_reached.cs","loc":63,"old-loc":64,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_reading_a_message_from_a_channel_pump_out_to_command_processor.cs","loc":52,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/MessageDispatch/Reactor/When_running_a_message_pump_on_a_thread_should_be_able_to_stop.cs","loc":58,"old-loc":59,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/Observability/MessageDispatch/When_A_Message_Is_Dispatched_It_Should_Begin_A_Span.cs","loc":116,"old-loc":117,"code-health":9.3931346077612,"old-code-health":9.3931346077612},{"file":"tests/Paramore.Brighter.Core.Tests/Observability/MessageDispatch/When_There_Are_No_Messages_Close_The_Span.cs","loc":85,"old-loc":86,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/Observability/MessageDispatch/When_There_Is_A_BrokenCircuit_Channel_Failure_Close_The_Span.cs","loc":97,"old-loc":98,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/Observability/MessageDispatch/When_There_Is_A_Channel_Failure_Close_The_Span.cs","loc":97,"old-loc":98,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/Observability/MessageDispatch/When_There_Is_A_Quit_Message_Close_The_Span.cs","loc":85,"old-loc":86,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/Observability/MessageDispatch/When_There_Is_An_Unacceptable_Messages_Close_The_Span.cs","loc":91,"old-loc":92,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/MessageDispatch/When_building_a_dispatcher.cs","loc":103,"old-loc":104,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/MessageDispatch/When_building_a_dispatcher_async.cs","loc":102,"old-loc":103,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/MessageDispatch/When_building_a_dispatcher_with_named_gateway.cs","loc":87,"old-loc":88,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/MessageDispatch/When_building_a_dispatcher_with_named_gateway_async.cs","loc":87,"old-loc":88,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/MessagingGateway/When_retry_limits_force_a_message_onto_the_DLQ.cs","loc":110,"old-loc":111,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.RMQ.Tests/MessagingGateway/When_retry_limits_force_a_message_onto_the_DLQ_async.cs","loc":108,"old-loc":109,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/Pipelines.cs","loc":23,"old-loc":23,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Paramore.Brighter.Core.Tests/CommandProcessors/When_No_Request_Context_Is_Provided.cs","loc":238,"old-loc":238,"code-health":9.096655465156704,"old-code-health":9.096655465156704}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"3454","analysis-time":"2025-01-04T21:50:13Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":9,"commits":["e2055e9332355af273bf4d19d847f34cf3791a69","97b74f52811223c5f08fb739d286871f5a80451e","14f5a89428c4a20474710f0a411726ee751be6a4","966e981967ce3615556fbfba3317746ef08eff0f","149663c2d24f3c2599874014cbb0c16f5bce36ef","5a0a8cbf55c1118a9bc9f094a8205380f32e4789","fb81b76e443f290082cffbbd39549afe189b2e5d","86f08484c383c14d5118013e847473e629fe06dd"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"PushOntoAsyncPipeline","why-it-occurs":"Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.\n\nThe threshold for the C# language is 4 function arguments.","name":"Excess Number of Function Arguments","file":"src/Paramore.Brighter/PipelineBuilder.cs","refactoring-examples":[{"architectural-component-id":null,"author-name":"DevJonny","training-data":{"loc-added":"20","loc-deleted":"14","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"7.534418959981518"},"author-email":"jonny.ollifflee@gmail.com","commit-full-message":"JSON and YAML outputs previously described different documents because Neuroglia\n4.20.0 applies different default naming conventions in its JSON and YAML serialisers,\nand embedded JSON Schema fragments emitted PascalCase property names that did not\nmatch Brighter's camelCase wire format.\n\nLibrary changes:\n\n- Derive YAML from the JSON tree we just wrote. Guarantees both formats describe the\n  same document, regardless of upstream serialiser config drift.\n- Strip Neuroglia internals (isReference) and empty collections from both outputs.\n- Switch NJsonSchema generator to System.Text.Json reflection with camelCase property\n  policy and JsonStringEnumConverter, mirroring JsonSerialisationOptions.Options. The\n  schema now describes what JsonMessageMapper actually puts on the wire.\n- Declare draft-04 in SchemaFormat to match what NJsonSchema 11.x emits\n  (JsonSchema.ToJson hardcodes the dialect).\n- Refactor ProcessSourceAsync to take a MessageSource record, resolving the CodeScene\n  excess-arguments check.\n- Backfill missing XML docs on AsyncApiOptions and fix a stale paramref on\n  IAmASchemaGenerator.\n\nSample fix:\n\n- Kafka sample no longer requires a live broker for --generate-asyncapi.\n  KafkaProducerRegistryFactory.Create connects eagerly, so build it only on the\n  runtime path; assembly scanning still surfaces publications in the doc.\n\nTests: 46/46 pass on net9.0 and net10.0.\n\nCo-Authored-By: Claude <noreply@anthropic.com>","commit-date":"2026-05-16T19:01:42Z","current-rev":"5e03da283","filename":"Brighter/src/Paramore.Brighter.AsyncAPI/AsyncApiDocumentGenerator.cs","previous-rev":"70b03a0ee","commit-title":"fix(#3828): align AsyncAPI output with wire format, eliminate JSON/YAML divergence","language":"C#","id":"f49c3320ae617404ccf0324e7fe2dad4565432c7","model-score":0.28,"author-id":null,"project-id":32198,"delta-file-score":0.22637527,"diff":"diff --git a/src/Paramore.Brighter.AsyncAPI/AsyncApiDocumentGenerator.cs b/src/Paramore.Brighter.AsyncAPI/AsyncApiDocumentGenerator.cs\nindex 2a306a512..bd7ae8957 100644\n--- a/src/Paramore.Brighter.AsyncAPI/AsyncApiDocumentGenerator.cs\n+++ b/src/Paramore.Brighter.AsyncAPI/AsyncApiDocumentGenerator.cs\n@@ -51,2 +51,10 @@ private sealed record GenerationContext(\n \n+        // Inputs that vary per call into ProcessSourceAsync. Grouping them keeps the method\n+        // signature small (and satisfies the CodeScene \"Excess Number of Function Arguments\"\n+        // check) without flattening the call sites with positional parameters.\n+        private sealed record MessageSource(\n+            string Address,\n+            V3OperationAction Action,\n+            Type? RequestType);\n+\n         private readonly AsyncApiOptions _options;\n@@ -116,3 +124,3 @@ private async Task AddSubscriptionsAsync(\n                 await ProcessSourceAsync(\n-                    subscription.RoutingKey.Value, V3OperationAction.Receive, subscription.RequestType,\n+                    new MessageSource(subscription.RoutingKey.Value, V3OperationAction.Receive, subscription.RequestType),\n                     context, ct).ConfigureAwait(false);\n@@ -133,3 +141,3 @@ private async Task AddPublicationsAsync(\n                 await ProcessSourceAsync(\n-                    publication.Topic.Value, V3OperationAction.Send, publication.RequestType,\n+                    new MessageSource(publication.Topic.Value, V3OperationAction.Send, publication.RequestType),\n                     context, ct).ConfigureAwait(false);\n@@ -139,5 +147,3 @@ await ProcessSourceAsync(\n         private async Task ProcessSourceAsync(\n-            string address,\n-            V3OperationAction action,\n-            Type? requestType,\n+            MessageSource source,\n             GenerationContext context,\n@@ -145,11 +151,11 @@ private async Task ProcessSourceAsync(\n         {\n-            var channelId = SanitizeChannelId(address);\n+            var channelId = SanitizeChannelId(source.Address);\n \n-            EnsureChannel(context.Channels, channelId, address);\n+            EnsureChannel(context.Channels, channelId, source.Address);\n \n             string messageName;\n-            if (requestType != null)\n+            if (source.RequestType != null)\n             {\n-                messageName = requestType.Name;\n-                await EnsureMessageAsync(context.Messages, messageName, requestType, ct).ConfigureAwait(false);\n+                messageName = source.RequestType.Name;\n+                await EnsureMessageAsync(context.Messages, messageName, source.RequestType, ct).ConfigureAwait(false);\n             }\n@@ -163,3 +169,3 @@ private async Task ProcessSourceAsync(\n \n-            var actionString = action == V3OperationAction.Send ? \"send\" : \"receive\";\n+            var actionString = source.Action == V3OperationAction.Send ? \"send\" : \"receive\";\n             context.CoveredChannelActions.Add((channelId, actionString));\n@@ -169,3 +175,3 @@ private async Task ProcessSourceAsync(\n             {\n-                Action = action,\n+                Action = source.Action,\n                 Channel = new V3ReferenceDefinition { Reference = $\"#/channels/{channelId}\" },\n@@ -290,3 +296,3 @@ private static void EnsurePlaceholderMessage(Dictionary<string, V3MessageDefinit\n                     {\n-                        SchemaFormat = \"application/schema+json;version=draft-07\",\n+                        SchemaFormat = \"application/schema+json;version=draft-04\",\n                         Schema = emptyDoc.RootElement.Clone()\n@@ -332,3 +338,3 @@ private static V3SchemaDefinition EmptyObjectSchema()\n             {\n-                SchemaFormat = \"application/schema+json;version=draft-07\",\n+                SchemaFormat = \"application/schema+json;version=draft-04\",\n                 Schema = doc.RootElement.Clone()\n","improvement-type":"Excess Number of Function Arguments"}],"change-level":"warning","is-hotspot?":false,"line":376,"what-changed":"PushOntoAsyncPipeline has 5 arguments, threshold = 4","how-to-fix":"Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring [INTRODUCE PARAMETER OBJECT](https://refactoring.com/catalog/introduceParameterObject.html) to encapsulate arguments that refer to the same logical concept.","change-type":"introduced"}]},"positive-impact-count":3,"repo":"Brighter","code-health":9.49682430147112,"version":"3.0","authors":["Paul Reardon"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":3,"number-of-files-touched":3,"findings":[{"name":"Code Duplication","file":"src/Paramore.Brighter/PipelineBuilder.cs","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.","how-to-fix":"A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. [Read More](https://codescene.com/blog/software-revolution-part3/)\n\nOnce you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.","what-changed":"reduced similar code in: PipelineBuilder,PipelineBuilder"},{"method":"Build","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the C# language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"src/Paramore.Brighter.ServiceActivator/ControlBus/ControlBusReceiverBuilder.cs","change-level":"improvement","is-hotspot?":true,"line":112,"what-changed":"Build decreases from 74 to 73 lines of code, threshold = 70","how-to-fix":"We recommend to be careful here -- just splitting long functions don't necessarily make the code easier to read. Instead, look for natural chunks inside the functions that expresses a specific task or concern. Often, such concerns are indicated by a Code Comment followed by an if-statement. Use the [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring to encapsulate that concern.","change-type":"improved"},{"method":"Dispatcher","why-it-occurs":"Counts the maximum number of arguments to each class' constructor. Too many arguments give a lower code health score. The rationale is that many constructor arguments indicate either a unit with low cohesion or an injection of dependencies on the wrong abstraction level.","name":"Constructor Over-Injection","file":"src/Paramore.Brighter.ServiceActivator/Dispatcher.cs","change-level":"improvement","is-hotspot?":true,"line":160,"what-changed":"Dispatcher is no longer above the threshold for number of arguments","how-to-fix":"There are multiple ways of addressing constructor over-injection. Sometimes you can introduce [FACADE](https://en.wikipedia.org/wiki/Facade_pattern) services that encapsulate lower-level dependencies.\n\nIn many cases, Constructor Over-Injection is a symptom of a deeper problem. Make sure to investigate the root cause, and get some inspiration and examples from [Mark Seemann's article](https://blog.ploeh.dk/2018/08/27/on-constructor-over-injection/) on the issue.","change-type":"fixed"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2025-01-04T21:50:12.000Z","project-name":"Brighter","repository":"https://github.com/BrighterCommand/Brighter.git"}}