{"results":{"result":{"added-files":{"code-health":9.61332563022822,"old-code-health":0.0,"files":[{"file":"tests/Umbraco.Tests.Benchmarks/Fixtures/SyntheticPublishedTreeFixture.cs","loc":206,"code-health":9.441211427903685},{"file":"tests/Umbraco.Tests.Benchmarks/HybridCacheNavigationBenchmarks.cs","loc":90,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.HybridCache/PublishedContentTests.cs","loc":146,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Navigation/NavigationNodeTests.cs","loc":157,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/Navigation/ContentNavigationDescendantsCacheTests.cs","loc":295,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.HybridCache/DocumentCacheSyncFastPathTests.cs","loc":64,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/PublishStatus/PublishedMediaStatusFilteringServiceTests.cs","loc":56,"code-health":10.0}]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/22742","old-code-health":8.055705918632457,"modified-files":{"code-health":7.993456147646994,"old-code-health":8.055705918632457,"files":[{"file":"src/Umbraco.Core/Extensions/PublishedContentExtensions.cs","loc":1063,"old-loc":1065,"code-health":5.942352211491833,"old-code-health":5.942352211491833},{"file":"src/Umbraco.Core/Services/PublishStatus/PublishedContentStatusFilteringService.cs","loc":50,"old-loc":50,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/Services/PublishStatus/PublishedMediaStatusFilteringService.cs","loc":14,"old-loc":14,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.PublishedCache.HybridCache/PublishedContent.cs","loc":247,"old-loc":231,"code-health":9.096655465156704,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Core/Models/Navigation/NavigationNode.cs","loc":93,"old-loc":39,"code-health":9.387218218812514,"old-code-health":10.0},{"file":"src/Umbraco.Core/Services/Navigation/ContentNavigationServiceBase.cs","loc":571,"old-loc":511,"code-health":9.387218218812514,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Core/PublishedCache/IDocumentCacheService.cs","loc":25,"old-loc":20,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/PublishedCache/IMediaCacheService.cs","loc":25,"old-loc":20,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.PublishedCache.HybridCache/DocumentCache.cs","loc":53,"old-loc":46,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.PublishedCache.HybridCache/MediaCache.cs","loc":39,"old-loc":33,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs","loc":336,"old-loc":327,"code-health":9.096655465156704,"old-code-health":9.096655465156704},{"file":"src/Umbraco.PublishedCache.HybridCache/Services/MediaCacheService.cs","loc":298,"old-loc":289,"code-health":9.387218218812514,"old-code-health":9.6882083290695},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/PublishStatus/PublishedContentStatusFilteringServiceTests.cs","loc":455,"old-loc":378,"code-health":7.552876135642913,"old-code-health":7.552876135642913}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"22742","analysis-time":"2026-05-07T10:51:06Z","negative-impact-count":7,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["f9d480f88273313f565d18de6b6994b19326c60b","c94b346d1e286dc90b08b9666a2332c9f5c1f941","790d6a4b8d4edfb01159ac02b5ef09c5b911862c","afe90992f21f1308422dd44315bef8a8d1a624c8","dc95a562908fd08c8cbaaccefb94a545f84469b6","d2ec817c1bc0a09caa213b51c6caf0c7ce5e38c3","51b190c1ea5261bd3789bb56d0f11c8f96a338a9","ef14310c5c7bda87d437b2defc42b7f5cf82d8ed","e0a5682c11d4cd1d7baf9eb12357595087f5a1f4","b57783de9de715f7f80e1d36d805fd0f19212223"],"is-negative-review":true,"negative-findings":{"number-of-types":5,"number-of-files-touched":7,"findings":[{"method":"InitialiseAsync","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":"tests/Umbraco.Tests.Benchmarks/Fixtures/SyntheticPublishedTreeFixture.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":48,"what-changed":"InitialiseAsync has 101 lines, 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":"introduced"},{"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).","name":"Overall Code Complexity","file":"src/Umbraco.PublishedCache.HybridCache/PublishedContent.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"what-changed":"This module has a mean cyclomatic complexity of 4.50 across 8 functions. The mean complexity threshold is 4","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","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/Models/Navigation/NavigationNode.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":93,"what-changed":"The module contains 2 functions with similar structure: AddChild,RemoveChild","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":"TryGetDescendantsKeysFromStructure","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.Core/Services/Navigation/ContentNavigationServiceBase.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":731,"what-changed":"TryGetDescendantsKeysFromStructure 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"},{"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.Core/Models/Navigation/NavigationNodeTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":59,"what-changed":"The module contains 2 functions with similar structure: GetOrderedChildren_AddChild_InvalidatesCacheAndIncludesNewChild,GetOrderedChildren_RemoveChild_InvalidatesCacheAndExcludesChild","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":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/Navigation/ContentNavigationDescendantsCacheTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":70,"what-changed":"The module contains 4 functions with similar structure: TryGetDescendantsKeysInBin_AfterRemoveFromBin_RebuildsBinDescendantsCache,TryGetDescendantsKeysInBin_AfterRestoreFromBin_RebuildsBinDescendantsCache,TryGetDescendantsKeysOfType_AfterAdd_RebuildsAndIncludesMatchingNewNode,TryGetDescendantsKeys_AfterAdd_RebuildsAndIncludesNewNode","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, 35 % of all functions have primitive types as arguments.","name":"Primitive Obsession","file":"src/Umbraco.PublishedCache.HybridCache/Services/MediaCacheService.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, 35.5% 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"}]},"positive-impact-count":2,"repo":"Umbraco-CMS","code-health":8.376960153095832,"version":"3.0","authors":["Andy Butland"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":2,"number-of-files-touched":2,"findings":[{"name":"Lines of Code in a Single File","file":"src/Umbraco.Core/Extensions/PublishedContentExtensions.cs","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"This module has 1001 lines of code (comments stripped away). This puts the module at risk of evolving into a Brain Class. Brain Classes are problematic since changes become more complex over time, harder to test, and challenging to refactor. Act now to prevent future maintenance issues.","how-to-fix":"Look for opportunities to modularize the design. This is done by identifying groups of functions that represent different responsibilities and/or operate on different data. Once you have identified the different responsibilities, then use refactorings like [EXTRACT CLASS](https://refactoring.com/catalog/extractClass.html).","what-changed":"The lines of code decreases from 1003 to 1001, improve code health by reducing it to 1000"},{"name":"Primitive Obsession","file":"src/Umbraco.Core/Services/Navigation/ContentNavigationServiceBase.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, 55 % 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 58.06% to 54.55%, threshold = 30.0%"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-05-07T10:51:05.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}