{"results":{"result":{"added-files":{"code-health":9.342995563584397,"old-code-health":0.0,"files":[{"file":"src/Paramore.Brighter.Extensions.Configuration/ConfigurationExtensions.cs","loc":71,"code-health":10.0},{"file":"src/Paramore.Brighter.Extensions.Configuration/MicrosoftConfiguration.cs","loc":22,"code-health":10.0},{"file":"src/Paramore.Brighter.MessagingGateway.RMQ.Async/RmqMessagingGatewayFromConfigurationFactory.cs","loc":219,"code-health":8.816158827775617},{"file":"src/Paramore.Brighter/ConfigurationFactory/PublicationConfiguration.cs","loc":39,"code-health":10.0},{"file":"src/Paramore.Brighter/ConfigurationFactory/SubscriptionConfiguration.cs","loc":83,"code-health":9.6882083290695}]},"external-review-url":"https://github.com/BrighterCommand/Brighter/pull/3916","old-code-health":0.0,"modified-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"3916","analysis-time":"2026-01-19T09:59:39Z","negative-impact-count":4,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["a66908dccc3f42dd4eb7c86b53b69ff62b514150","c78d2992c35f8a5da52eed7ebffa4437c310178f","ce93ef4d3d033c6e1ac4f5898875e991ff9331aa","5474adeb146456adaeaef8eaa760b4c2cfd9ac94"],"is-negative-review":true,"negative-findings":{"number-of-types":4,"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.MessagingGateway.RMQ.Async/RmqMessagingGatewayFromConfigurationFactory.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":97,"what-changed":"The module contains 2 functions with similar structure: CreateMessageProducerFactory,CreateProducerRegistryFactory","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":"introduced"},{"why-it-occurs":"Code that uses a high degree of built-in, primitives such as integers, strings, floats, lacks a domain language that encapsulates the validation and semantics of function arguments. Primitive Obsession has several consequences: 1) In a statically typed language, the compiler will detect less erroneous assignments. 2) Security impact since the possible value range of a variable/argument isn't retricted.\n\nIn this module, 64 % of all functions have primitive types as arguments.","name":"Primitive Obsession","file":"src/Paramore.Brighter.MessagingGateway.RMQ.Async/RmqMessagingGatewayFromConfigurationFactory.cs","refactoring-examples":[{"diff":"diff --git a/primitive-obsession.ts b/primitive-obsession.ts\nindex 38bae186cc..24116eddcc 100644\n--- a/primitive-obsession.ts\n+++ b/primitive-obsession.ts\n@@ -1,8 +1,8 @@\n-// Problem: It's hard to know what this function does, and what values are valid as parameters.\n-function getPopularRepositories(String baseURL, String query, Integer pages, Integer pageSize, String sortorder): Json {\n-\tlet pages == null ? 10 : pages\n-\tlet pageSize == null ? 10 : pageSize\n-  return httpClient.get(`${baseURL}?q=${query}&pages=${pages}&pageSize=${pageSize}&sortorder=${sortorder}`)\n+// Refactoring: extract the pagination & API logic into a class, and it will\n+// attract validation and other logic related to the specific query. It's now\n+// easier to use and to maintain the getPopularRepositories function!\n+function getPopularRepositories(query: PaginatedRepoQuery): Json {\n+  return httpClient.get(query.getURL())\n     .map(json => json.repositories)\n     .filter(repository => repositry.stargazersCount > 1000)\n }\n","language":"c#","improvement-type":"Primitive Obsession"}],"change-level":"warning","is-hotspot?":false,"what-changed":"In this module, 63.6% of all function arguments are primitive types, threshold = 30.0%","how-to-fix":"Primitive Obsession indicates a missing domain language. Introduce data types that encapsulate the details and constraints of your domain. For example, instead of `int userId`, consider `User clicked`.","change-type":"introduced"},{"why-it-occurs":"String is a generic type that fail to capture the constraints of the domain object it represents. In this module, 64 % of all function arguments are string types.","name":"String Heavy Function Arguments","file":"src/Paramore.Brighter.MessagingGateway.RMQ.Async/RmqMessagingGatewayFromConfigurationFactory.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"what-changed":"In this module, 63.6% of all arguments to its 10 functions are strings. The threshold for string arguments is 39.0%","how-to-fix":"Heavy string usage indicates a missing domain language. Introduce data types that encapsulate the semantics. For example, a user_name is better represented as a constrained User type rather than a pure string, which could be anything.","change-type":"introduced"},{"method":"GetRequestType","why-it-occurs":"A complex conditional is an expression inside a branch such as an <code>if</code>-statmeent which consists of multiple, logical operations. Example: <code>if (x.started() && y.running())</code>.Complex conditionals make the code even harder to read, and contribute to the Complex Method code smell. Encapsulate them.","name":"Complex Conditional","file":"src/Paramore.Brighter/ConfigurationFactory/SubscriptionConfiguration.cs","refactoring-examples":[{"diff":"diff --git a/complex_conditional.js b/complex_conditional.js\nindex c43da09584..94259ce874 100644\n--- a/complex_conditional.js\n+++ b/complex_conditional.js\n@@ -1,16 +1,34 @@\n function messageReceived(message, timeReceived) {\n-   // Ignore all messages which aren't from known customers:\n-   if (!message.sender &&\n-       customers.getId(message.name) == null) {\n+   // Refactoring #1: encapsulate the business rule in a\n+   // function. A clear name replaces the need for the comment:\n+   if (!knownCustomer(message)) {\n      log('spam received -- ignoring');\n      return;\n    }\n \n-  // Provide an auto-reply when outside business hours:\n-  if ((timeReceived.getHours() > 17) ||\n-      (timeReceived.getHours() < 8)) {\n+  // Refactoring #2: encapsulate the business rule.\n+  // Again, note how a clear function name replaces the\n+  // need for a code comment:\n+  if (outsideBusinessHours(timeReceived)) {\n     return autoReplyTo(message);\n   }\n \n   pingAgentFor(message);\n+}\n+\n+function outsideBusinessHours(timeReceived) {\n+  // Refactoring #3: replace magic numbers with\n+  // symbols that communicate with the code reader:\n+  const closingHour = 17;\n+  const openingHour = 8;\n+\n+  const hours = timeReceived.getHours();\n+\n+  // Refactoring #4: simple conditional rules can\n+  // be further clarified by introducing a variable:\n+  const afterClosing = hours > closingHour;\n+  const beforeOpening = hours < openingHour;\n+\n+  // Yeah -- look how clear the business rule is now!\n+  return afterClosing || beforeOpening;\n }\n\\ No newline at end of file\n","language":"c#","improvement-type":"Complex Conditional"}],"change-level":"warning","is-hotspot?":false,"line":269,"what-changed":"GetRequestType has 1 complex conditionals with 2 branches, threshold = 2","how-to-fix":"Apply the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring so that the complex conditional is encapsulated in a separate function with a good name that captures the business rule. Optionally, for simple expressions, introduce a new variable which holds the result of the complex conditional.","change-type":"introduced"}]},"positive-impact-count":0,"repo":"Brighter","code-health":9.342995563584397,"version":"3.0","authors":["Rafael Andrade"],"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-01-19T09:59:38.000Z","project-name":"Brighter","repository":"https://github.com/BrighterCommand/Brighter.git"}}