{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/BrighterCommand/Brighter/pull/4065","old-code-health":8.58202720007437,"modified-files":{"code-health":8.52422587709344,"old-code-health":8.58202720007437,"files":[{"file":"src/Paramore.Brighter.MessageScheduler.Hangfire/HangfireMessageSchedulerFactory.cs","loc":19,"old-loc":14,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.MessagingGateway.AWSSQS.V4/SqsMessageConsumer.cs","loc":426,"old-loc":426,"code-health":9.139589479072994,"old-code-health":9.139589479072994},{"file":"src/Paramore.Brighter.MessagingGateway.AWSSQS/SqsMessageConsumer.cs","loc":429,"old-loc":429,"code-health":9.139589479072994,"old-code-health":9.139589479072994},{"file":"src/Paramore.Brighter.ServiceActivator/Performer.cs","loc":46,"old-loc":46,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/CloudEventsType.cs","loc":23,"old-loc":23,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/InternalBus.cs","loc":45,"old-loc":45,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Paramore.Brighter/JsonConverters/IdConverter.cs","loc":29,"old-loc":21,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/PipelineBuilder.cs","loc":422,"old-loc":398,"code-health":7.788037646779413,"old-code-health":7.788037646779413},{"file":"src/Paramore.Brighter/RequestHandler.cs","loc":73,"old-loc":71,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Paramore.Brighter/SubscriptionName.cs","loc":55,"old-loc":55,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter/TransformPipelineBuilder.cs","loc":200,"old-loc":196,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Paramore.Brighter/TransformPipelineBuilderAsync.cs","loc":175,"old-loc":161,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Paramore.Brighter/Transforms/Transformers/CompressPayloadTransformer.cs","loc":200,"old-loc":201,"code-health":8.545379580978913,"old-code-health":8.816158827775617},{"file":"src/Paramore.Brighter/Observability/Baggage.cs","loc":80,"old-loc":60,"code-health":10.0,"old-code-health":10.0},{"file":"src/Paramore.Brighter.MessagingGateway.Redis/RedisMessageConsumer.cs","loc":570,"old-loc":552,"code-health":6.327811554085365,"old-code-health":6.717068846404382},{"file":"src/Paramore.Brighter.MessagingGateway.Redis/RedisMessageProducer.cs","loc":150,"old-loc":145,"code-health":10.0,"old-code-health":9.387218218812514}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"4065","analysis-time":"2026-05-06T22:22:25Z","negative-impact-count":2,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":3,"commits":["ab213d72d34f743c354fbc33c4596f3aff87a379","4790e46cacda2a586a33876b80f8598ac6443899","6d461d54a4b5f82f1124ae5967fefb11d5cae7d3","33dae76aa7d50c43808d54283a31229c5c3a0c3e","e85c07c21cd3eb7887720eb08f81ddb4bef9f78f","b145265c50378b656e93e73fb7f563c69f931034","976d910db14d33a5051b024c3e500a5d62676fab","1a8a2746da98cd99b946ffbe6b7289be613b3964","7d56d7b2f3c3ead4aeb66cc9a097426089806413","31b3b42b8d10cb7759d2680cc0a7feb0d5a30891","e1102c718c190c9d77f931dab9cb6b5cda9e37d1"],"is-negative-review":true,"negative-findings":{"number-of-types":2,"number-of-files-touched":2,"findings":[{"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.","name":"Code Duplication","file":"src/Paramore.Brighter/Transforms/Transformers/CompressPayloadTransformer.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":96,"what-changed":"introduced similar code in: Wrap,WrapAsync","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.","change-type":"degraded"},{"why-it-occurs":"Cohesion is a measure of how well the elements in a file belong together. CodeScene measures cohesion using the LCOM4 metric (Lack of Cohesion Measure). With LCOM4, the functions inside a module are related if a) they access the same data members, or b) they call each other. High Cohesion is desirable as it means that all functions are related and likely to represent the same responsibility. Low Cohesion is problematic since it means that the module contains multiple behaviors. Low Cohesion leads to code that's harder to understand, requires more tests, and very often become a coordination magnet for developers.","name":"Low Cohesion","file":"src/Paramore.Brighter.MessagingGateway.Redis/RedisMessageConsumer.cs","refactoring-examples":[{"diff":"diff --git a/low_cohesion_example.js b/low_cohesion_example.js\nindex 1ae56cf85b..209fc02c73 100644\n--- a/low_cohesion_example.js\n+++ b/low_cohesion_example.js\n@@ -2,8 +2,10 @@\n \n var userLayer = connectUsers(myConnectionProperties);\n \n-var chessEngine = startEngine(gameProperties);\n+// [Refactoring: moved the data related to chess to a new chessGame.js module]\n \n+// The module contains login related functionality that forms one behaviour: all\n+// code is related since it either a) uses the same data, or b) calls the same functions.\n export function login(newUser) {\n   val authenticated = userLayer.authenticate(newUser);\n   traceLoginFor(authenticated);\n@@ -19,11 +21,6 @@ function traceLogin(user) {\n    // ...some code...\n }\n \n-// playChess seems like a very unrelated responsibility.\n-// Should it really be within the same module?\n-\n-export function playChess(loggedInUser) {\n-   var board = chessEngine.newBoard();\n-\n-   return newGameOn(board, loggedInUser);\n-}\n+// [Refactoring: moved playChess to a new chessGame.js module\n+// As a result of this refactoring, the module maintains a\n+// single behavior where all code and data is related: high cohesion.]\n","language":"c#","improvement-type":"Low Cohesion"}],"change-level":"warning","is-hotspot?":true,"what-changed":"This module has at least 3 different responsibilities amongst its 26 functions, threshold = 3","how-to-fix":"Look to modularize the code by splitting the file into more cohesive units; functions that belong together should still be located together. A common refactoring is [EXTRACT CLASS](https://refactoring.com/catalog/extractClass.html).","change-type":"introduced"}]},"positive-impact-count":3,"repo":"Brighter","code-health":8.52422587709344,"version":"3.0","authors":["Tom Longhurst"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":2,"number-of-files-touched":3,"findings":[{"name":"Overall Code Complexity","file":"src/Paramore.Brighter/Transforms/Transformers/CompressPayloadTransformer.cs","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better.\n\nCyclomatic complexity is a function level metric that measures the number of logical branches (if-else, loops, etc.). Cyclomatic complexity is a rough complexity measure, but useful as a way of estimating the minimum number of unit tests you would need. As such, prefer functions with low cyclomatic complexity (2-3 branches).","how-to-fix":"You address the overall cyclomatic complexity by a) modularizing the code, and b) abstract away the complexity. Let's look at some examples:\n\nModularizing the Code: Do an X-Ray and inspect the local hotspots. Are there any complex conditional expressions? If yes, then do a [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring. Extract the conditional logic into a separate function and put a good name on that function. This clarifies the intent and makes the original function easier to read. Repeat until all complex conditional expressions have been simplified.\n\n","what-changed":"The mean cyclomatic complexity decreases from 4.20 to 4.10, threshold = 4"},{"name":"Code Duplication","file":"src/Paramore.Brighter.MessagingGateway.Redis/RedisMessageConsumer.cs","change-type":"improved","change-level":"improvement","is-hotspot?":true,"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: Receive,ReceiveAsync,Requeue,RequeueAsync"},{"name":"Code Duplication","file":"src/Paramore.Brighter.MessagingGateway.Redis/RedisMessageProducer.cs","change-type":"fixed","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":"The module no longer contains too many functions with similar structure"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-05-06T22:22:25.000Z","project-name":"Brighter","repository":"https://github.com/BrighterCommand/Brighter.git"}}