{"results":{"result":{"added-files":{"code-health":9.665643321675615,"old-code-health":0.0,"files":[{"file":"src/Umbraco.Core/Notifications/ElementRefreshNotification.cs","loc":13,"code-health":10.0},{"file":"src/Umbraco.Core/Services/Navigation/ElementNavigationService.cs","loc":23,"code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/DocumentPublishStatusService.cs","loc":88,"code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/ElementPublishStatusService.cs","loc":52,"code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/IDocumentPublishStatusQueryService.cs","loc":7,"code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/IElementPublishStatusQueryService.cs","loc":6,"code-health":10.0},{"file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Element/ElementBreadthFirstKeyProvider.cs","loc":67,"code-health":8.907631620632795},{"file":"tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/ElementCacheServiceTests.cs","loc":174,"code-health":9.387218218812514},{"file":"src/Umbraco.PublishedCache.HybridCache/ElementCache.cs","loc":13,"code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/ElementHybridCacheElementTypeTests.cs","loc":93,"code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/ElementHybridCacheTests.cs","loc":131,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.HybridCache/ElementBreadthFirstKeyProviderTests.cs","loc":196,"code-health":9.387218218812514},{"file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Element/ElementContentTypeSeedKeyProvider.cs","loc":34,"code-health":10.0}]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/22369","old-code-health":7.826162671556325,"modified-files":{"code-health":7.576887085928741,"old-code-health":7.823955730106128,"files":[{"file":"src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ElementRepository.cs","loc":85,"old-loc":85,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.PublishedCache.HybridCache/DatabaseCacheRebuilder.cs","loc":96,"old-loc":96,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.PublishedCache.HybridCache/DependencyInjection/UmbracoBuilderExtensions.cs","loc":84,"old-loc":78,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.PublishedCache.HybridCache/NotificationHandlers/CacheRefreshingNotificationHandler.cs","loc":144,"old-loc":120,"code-health":10.0,"old-code-health":9.387218218812514},{"file":"src/Umbraco.PublishedCache.HybridCache/NotificationHandlers/SeedingNotificationHandler.cs","loc":42,"old-loc":34,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs","loc":1639,"old-loc":1420,"code-health":4.315411156256639,"old-code-health":4.954565848685716},{"file":"src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs","loc":302,"old-loc":302,"code-health":9.096655465156704,"old-code-health":9.096655465156704},{"file":"src/Umbraco.PublishedCache.HybridCache/Services/ElementCacheService.cs","loc":266,"old-loc":45,"code-health":9.387218218812514,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheMockTests.cs","loc":251,"old-loc":251,"code-health":8.997354731618337,"old-code-health":8.997354731618337},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.HybridCache/CacheRefreshingNotificationHandlerTests.cs","loc":227,"old-loc":135,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs","loc":474,"old-loc":403,"code-health":7.087364209900068,"old-code-health":7.087364209900068},{"file":"src/Umbraco.Core/Cache/Refreshers/Implement/ElementCacheRefresher.cs","loc":119,"old-loc":96,"code-health":9.387218218812514,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Core/DeliveryApi/ApiContentRouteBuilder.cs","loc":155,"old-loc":108,"code-health":8.545379580978913,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs","loc":350,"old-loc":340,"code-health":8.479690818425087,"old-code-health":8.527310954563237},{"file":"src/Umbraco.Core/Services/DocumentUrlService.cs","loc":963,"old-loc":882,"code-health":5.334217969169837,"old-code-health":5.8177870344608476},{"file":"src/Umbraco.Core/Services/Navigation/NavigationInitializationNotificationHandler.cs","loc":35,"old-loc":30,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/PublishStatusInitializationNotificationHandler.cs","loc":28,"old-loc":24,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/PublishStatusService.cs","loc":53,"old-loc":109,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/PublishedContentStatusFilteringService.cs","loc":45,"old-loc":45,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/PublishedMediaStatusFilteringService.cs","loc":12,"old-loc":12,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Infrastructure/Persistence/Repositories/Implement/PublishStatusRepository.cs","loc":141,"old-loc":109,"code-health":9.387218218812514,"old-code-health":10.0},{"file":"src/Umbraco.Infrastructure/Search/ContentTypeIndexingNotificationHandler.cs","loc":175,"old-loc":175,"code-health":8.633683434399467,"old-code-health":8.633683434399467},{"file":"src/Umbraco.PublishedCache.HybridCache/PublishedElement.cs","loc":140,"old-loc":140,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Document/ContentTypeSeedKeyProvider.cs","loc":34,"old-loc":34,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Document/DocumentBreadthFirstKeyProvider.cs","loc":63,"old-loc":63,"code-health":9.536386775820924,"old-code-health":9.536386775820924},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/DeliveryApiTests.cs","loc":144,"old-loc":144,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/PropertyValueConverterTests.cs","loc":141,"old-loc":141,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/PublishStatus/PublishedContentStatusFilteringServiceTests.cs","loc":311,"old-loc":311,"code-health":8.283981080161325,"old-code-health":8.283981080161325},{"file":"src/Umbraco.PublishedCache.HybridCache/Factories/CacheNodeFactory.cs","loc":167,"old-loc":167,"code-health":8.082396416641757,"old-code-health":8.082396416641757},{"file":"tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishStatusServiceTests.Management.cs","loc":106,"old-loc":106,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.PublishedCache.HybridCache/CacheManager.cs","loc":21,"old-loc":19,"code-health":9.6882083290695,"old-code-health":10.0},{"file":"src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs","loc":117,"old-loc":116,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Core/Services/Navigation/ContentNavigationServiceBase.cs","loc":498,"old-loc":500,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentNavigationRepository.cs","loc":51,"old-loc":41,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentNavigationServiceTest.cs","loc":84,"old-loc":84,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ElementPublishingServiceTests.Publish.cs","loc":131,"old-loc":130,"code-health":9.096655465156704,"old-code-health":9.096655465156704}]},"removed-files":{"code-health":0.0,"old-code-health":10.0,"files":[{"file":"src/Umbraco.Core/Services/PublishStatus/IPublishStatusQueryService.cs","loc":0,"old-loc":7,"old-code-health":10.0}]},"external-review-id":"22369","analysis-time":"2026-04-09T08:27:37Z","negative-impact-count":19,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["98454f0efcec43cd54ad1d8a707aa28e1aefc8f5","428beb3a7f9628c8b883394103cd27af3e1e11cd","a280c0efea7071e3928e4cc77def51742e665d9b","4ae8f7c8c24691a53eed108090ae2427ab73343a","fbb0cdcdaed777d27ae1de679b1ac138e8921d0f","c5654c3c266346df6c9ede3d3d919d94300bedf3","ef55f6ec108bfbb1a69827c1d405ea000fa8bd9d","352cc8feaf4c01fcc90b059812cf5caf9777c1b2","7ae58ec9b62a1feb01f5e78e913f0dab7492f597","ad677e3707b64bcc3e5f6fe5fff40b220ee468b4","c295fabd1ce1fc9637d5f28b23929a107d7818d9","bb16866b7881ceb697445fb72ea41981eb926ea9","149454909f9467508fb1f4b253b5bce635c75b43","f0cc846ab94d95c5d2dcd0c0d2dbc2ae6c44ccbe"],"is-negative-review":true,"negative-findings":{"number-of-types":9,"number-of-files-touched":12,"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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":59,"what-changed":"introduced similar code in: GetDocumentCultureDataForNodes,GetDocumentMetadataForNodes,GetDocumentSourceAsync,GetDocumentSourceForPublishStatesAsync and 12 more functions","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"},{"method":"Rebuild","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.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":207,"what-changed":"Rebuild increases from 1 complex conditionals with 5 branches to 1 complex conditionals with 7 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":"degraded"},{"method":"GetElementSourceAsync","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.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":103,"what-changed":"GetElementSourceAsync 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"},{"method":"GetDocumentSourceAsync","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.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":244,"what-changed":"GetDocumentSourceAsync 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"},{"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, 39 % of all functions have primitive types as arguments.","name":"Primitive Obsession","file":"src/Umbraco.PublishedCache.HybridCache/Services/ElementCacheService.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, 38.7% 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"},{"method":"ElementCacheService","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/Umbraco.PublishedCache.HybridCache/Services/ElementCacheService.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":55,"what-changed":"ElementCacheService has 10 arguments, max arguments = 5","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":"introduced"},{"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/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":84,"what-changed":"The module contains 3 functions with similar structure: ContentCacheRefresher,ContentCacheRefresher,ContentCacheRefresher","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"},{"method":"HandlePublishStatus","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/Umbraco.Core/Cache/Refreshers/Implement/ElementCacheRefresher.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":185,"what-changed":"HandlePublishStatus 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"},{"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/Umbraco.Core/DeliveryApi/ApiContentRouteBuilder.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":42,"what-changed":"The module contains 2 functions with similar structure: ApiContentRouteBuilder,ApiContentRouteBuilder","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":"This code health issue is measured as the average number of function arguments across the whole file. A function with many arguments can be simplified either by a) splitting the function if it has too many responsibilities, or b) by introducing an abstraction (class, record, struct, etc.) which encapsulates the arguments. ","name":"Missing Arguments Abstractions","file":"src/Umbraco.Core/DeliveryApi/ApiContentRouteBuilder.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"what-changed":"The average number of function arguments in this module is 4.63 across 8 functions. The average arguments threshold is 4.00","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"},{"method":"AddCoreServices","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/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":158,"what-changed":"AddCoreServices increases from 226 to 236 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":"degraded"},{"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/Umbraco.Core/Services/DocumentUrlService.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":139,"what-changed":"The module contains 5 functions with similar structure: DocumentUrlService,DocumentUrlService,DocumentUrlService,GetUrlSegment and 1 more functions","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":"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/Umbraco.Infrastructure/Persistence/Repositories/Implement/PublishStatusRepository.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":37,"what-changed":"The module contains 2 functions with similar structure: GetBaseQuery,GetElementBaseQuery","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"},{"method":"GetSeedKeys","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the C# language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Element/ElementBreadthFirstKeyProvider.cs","refactoring-examples":[{"diff":"diff --git a/complex_method.js b/complex_method.js\nindex 10cce78e6d..0c1a8cabaf 100644\n--- a/complex_method.js\n+++ b/complex_method.js\n@@ -1,15 +1,20 @@\n function postItem(item) {\n   if (!item.id) {\n-    if (item.x != null && item.y != null) {\n-      post(item);\n-    } else {\n-      throw Error(\"Item must have x and y\");\n-    }\n+    // extract a separate function for creating new item\n+    postNew(item);\n   } else {\n-    if (item.x < 10 && item.y > 25) {\n-      put(item);\n-    } else {\n-      throw Error(\"Item must have an x and y value between 10 and 25\");\n-    }\n+    // and one for updating existing items\n+    updateItem(item);\n   }\n }\n+\n+function postNew(item) {\n+  validateNew(item);\n+  post(item);\n+}\n+\n+function updateItem(item) {\n+  validateUpdate(item);\n+  put(item);\n+}\n+\n","language":"c#","improvement-type":"Complex Method"}],"change-level":"warning","is-hotspot?":false,"line":38,"what-changed":"GetSeedKeys has a cyclomatic complexity of 13, threshold = 9","how-to-fix":"There are many reasons for Complex Method. Sometimes, another design approach is beneficial such as a) modeling state using an explicit state machine rather than conditionals, or b) using table lookup rather than long chains of logic. In other scenarios, the function can be split using [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html). Just make sure you extract natural and cohesive functions. Complex Methods can also be addressed by identifying complex conditional expressions and then using the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring.","change-type":"introduced"},{"method":"GetSeedKeys","why-it-occurs":"A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health.\n\nA bumpy code road represents a lack of encapsulation which becomes an obstacle to comprehension. In imperative languages there’s also an increased risk for feature entanglement, which leads to complex state management. CodeScene considers the following rules for the code health impact: 1) The deeper the nested conditional logic of each bump, the higher the tax on our working memory. 2) The more bumps inside a function, the more expensive it is to refactor as each bump represents a missing abstraction. 3) The larger each bump – that is, the more lines of code it spans – the harder it is to build up a mental model of the function. The nesting depth for what is considered a bump is  levels of conditionals.","name":"Bumpy Road Ahead","file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Element/ElementBreadthFirstKeyProvider.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":38,"what-changed":"GetSeedKeys has 3 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function","how-to-fix":"Bumpy Road implementations indicate a lack of encapsulation. Check out the detailed description of the [Bumpy Road code health issue](https://codescene.com/blog/bumpy-road-code-complexity-in-context/).\n\nA Bumpy Road often suggests that the function/method does too many things. The first refactoring step is to identify the different possible responsibilities of the function. Consider extracting those responsibilities into smaller, cohesive, and well-named functions. The [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring is the primary response.","change-type":"introduced"},{"method":"GetSeedKeys","why-it-occurs":"Deep nested logic means that you have control structures like if-statements or loops inside other control structures. Deep nested logic increases the cognitive load on the programmer reading the code. The human working memory has a maximum capacity of 3-4 items; beyond that threshold, we struggle with keeping things in our head. Consequently, deep nested logic has a strong correlation to defects and accounts for roughly 20% of all programming mistakes.\n\nCodeScene measures the maximum nesting depth inside each function. The deeper the nesting, the lower the code health. The threshold for the C# language is 4 levels of nesting.","name":"Deep, Nested Complexity","file":"src/Umbraco.PublishedCache.HybridCache/SeedKeyProviders/Element/ElementBreadthFirstKeyProvider.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":38,"what-changed":"GetSeedKeys has a nested complexity depth of 4, threshold = 4","how-to-fix":"Occassionally, it's possible to get rid of the nested logic by [Replacing Conditionals with Guard Clauses](https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html).\n\nAnother viable strategy is to identify smaller building blocks inside the nested chunks of logic and extract those responsibilities into smaller, cohesive, and well-named functions. The [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring explains the steps.","change-type":"introduced"},{"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":"tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/ElementCacheServiceTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":97,"what-changed":"The module contains 4 functions with similar structure: CreateAndSaveElement,CreateSaveAndPublishElement,Rebuild_Creates_Draft_And_Published_Cache_Records,Rebuild_Creates_Draft_Cache_Record_With_Property_Data","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"},{"method":"CacheManager","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/Umbraco.PublishedCache.HybridCache/CacheManager.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":18,"what-changed":"CacheManager has 6 arguments, max arguments = 5","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":"introduced"},{"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":"tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.HybridCache/ElementBreadthFirstKeyProviderTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":29,"what-changed":"The module contains 2 functions with similar structure: OnlyReturnsKeysUpToSeedCount,ZeroSeedCountReturnsZeroKeys","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"}]},"positive-impact-count":9,"repo":"Umbraco-CMS","code-health":7.79497745299485,"version":"3.0","authors":["Laura Neto"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":7,"number-of-files-touched":5,"findings":[{"name":"Code Duplication","file":"src/Umbraco.PublishedCache.HybridCache/NotificationHandlers/CacheRefreshingNotificationHandler.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"},{"method":"GetContentSourcesAsync","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs","change-level":"improvement","is-hotspot?":false,"what-changed":"reduced similar code in: GetContentSourcesAsync","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":"improved"},{"method":"GetContentSourceAsync","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs","change-level":"improvement","is-hotspot?":false,"line":141,"what-changed":"GetContentSourceAsync no longer has a complex conditional","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":"fixed"},{"method":"BuildCacheDtosForDocument","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs","change-level":"improvement","is-hotspot?":false,"line":642,"what-changed":"BuildCacheDtosForDocument is no longer above the threshold for lines of code","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":"fixed"},{"method":"BuildCacheDtosForDocument","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/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs","change-level":"improvement","is-hotspot?":false,"line":642,"what-changed":"BuildCacheDtosForDocument is no longer above the threshold for number of arguments","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":"fixed"},{"name":"Overall Code Complexity","file":"src/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs","change-type":"fixed","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 in this module is no longer above the threshold"},{"method":"ContentCacheRefresher","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/Umbraco.Core/Cache/Refreshers/Implement/ContentCacheRefresher.cs","change-level":"improvement","is-hotspot?":false,"line":84,"what-changed":"ContentCacheRefresher decreases from 15 to 14 arguments, max arguments = 5","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":"improved"},{"name":"Primitive Obsession","file":"src/Umbraco.Core/Services/DocumentUrlService.cs","change-type":"improved","change-level":"improvement","is-hotspot?":false,"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, 41 % of all functions have primitive types as arguments.","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`.","what-changed":"The ratio of primitive types in function arguments decreases from 51.67% to 40.52%, threshold = 30.0%"},{"method":"Cannot_Get_Published_Again_After_Trashing","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":"tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ElementPublishingServiceTests.Publish.cs","change-level":"improvement","is-hotspot?":false,"what-changed":"reduced similar code in: Cannot_Get_Published_Again_After_Trashing","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":"improved"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-04-09T08:27:36.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}