{"results":{"result":{"added-files":{"code-health":9.6882083290695,"old-code-health":0.0,"files":[{"file":"src/Paramore.Brighter/NJsonConverters/NBaggageConverter.cs","loc":85,"code-health":9.6882083290695}]},"external-review-url":"https://github.com/BrighterCommand/Brighter/pull/4158","old-code-health":8.770297963747392,"modified-files":{"code-health":8.783426455237633,"old-code-health":8.770297963747392,"files":[{"file":"src/Paramore.Brighter/MessageHeader.cs","loc":218,"old-loc":218,"code-health":8.43184786202649,"old-code-health":8.43184786202649},{"file":"src/Paramore.Brighter/Observability/Baggage.cs","loc":63,"old-loc":60,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"4158","analysis-time":"2026-06-01T09:53:50Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["b14ff4c8a76cda7c988720561ad2cb5325f07cf1","cc05a2f10a7c477f444ddc03e95cc24cc4ae3648","d045d567f76cccb1428f67ffaed8ee85d1e7b75f","0ad3dea1cc06363afbf36df694aaa64d9ee32806","e645844871ce9fffdf64ade7b3c81ac19faab7e5","2df02aac3d99622de8603581e9c3c1339d383466"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"ReadJson","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/NJsonConverters/NBaggageConverter.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":39,"what-changed":"ReadJson has 5 arguments, max arguments = 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":0,"repo":"Brighter","code-health":8.993553393149405,"version":"3.0","authors":["DevJonny"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-06-01T09:53:49.000Z","project-name":"Brighter","repository":"https://github.com/BrighterCommand/Brighter.git"}}