{"results":{"result":{"added-files":{"code-health":9.668073403476184,"old-code-health":0.0,"files":[{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/Security/UriProviderTests.cs","loc":94,"code-health":10.0},{"file":"src/Umbraco.Web.Common/AspNetCore/ApplicationUrlConfigurationNotificationHandler.cs","loc":42,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/ApplicationUrlConfigurationNotificationHandlerTests.cs","loc":79,"code-health":9.096655465156704}]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/22307","old-code-health":9.707135667788602,"modified-files":{"code-health":9.641444859073342,"old-code-health":9.707135667788602,"files":[{"file":"src/Umbraco.Web.Common/AspNetCore/AspNetCoreHostingEnvironment.cs","loc":146,"old-loc":135,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs","loc":147,"old-loc":147,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/AspNetCoreHostingEnvironmentTests.cs","loc":198,"old-loc":39,"code-health":9.387218218812514,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Security/ForgotPasswordUriProvider.cs","loc":51,"old-loc":48,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Security/InviteUriProvider.cs","loc":51,"old-loc":45,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs","loc":107,"old-loc":98,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Core/HealthChecks/Checks/Security/ExcessiveHeadersCheck.cs","loc":73,"old-loc":64,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Core/HealthChecks/Checks/Security/HttpsCheck.cs","loc":179,"old-loc":155,"code-health":9.603465296750686,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Cms.Api.Management/Controllers/Security/ResetPasswordController.cs","loc":35,"old-loc":32,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/Security/SecurityControllerBase.cs","loc":38,"old-loc":34,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/User/UserOrCurrentUserControllerBase.cs","loc":180,"old-loc":176,"code-health":9.250540843812843,"old-code-health":9.27151197808207},{"file":"src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs","loc":270,"old-loc":269,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"22307","analysis-time":"2026-04-01T06:17:08Z","negative-impact-count":5,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["a1476ada0169790cd5efe1e3a19c0ad2d6e4103a","dd7ed6514f143611bdd9999524a02dffa159730c","b9847a5e72eef434d76c21979a7338031fb6f290","fe597feac59860b67f6a93a725d389b3777e1efc","00263a7b24d41a08662058340ad3b74fb9113b36","339ea81264e268395bee02de3b71dd4dc9d747aa","85e14b9a480cf91edac38ded314043204ba36b16"],"is-negative-review":true,"negative-findings":{"number-of-types":4,"number-of-files-touched":4,"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":"tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/AspNetCoreHostingEnvironmentTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":138,"what-changed":"The module contains 3 functions with similar structure: EnsureApplicationMainUrl_EveryRequest_ExplicitConfigTakesPrecedence,EnsureApplicationMainUrl_NoneMode_ExplicitConfigStillWorks,EnsureApplicationMainUrl_WithExplicitConfig_IgnoresHostHeader","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":"CheckForValidCertificate","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.Core/HealthChecks/Checks/Security/HttpsCheck.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":91,"what-changed":"CheckForValidCertificate increases in cyclomatic complexity from 9 to 10, 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":"degraded"},{"method":"UserOperationStatusResult","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.Cms.Api.Management/Controllers/User/UserOrCurrentUserControllerBase.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":14,"what-changed":"UserOperationStatusResult increases from 133 to 137 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":"tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/ApplicationUrlConfigurationNotificationHandlerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":34,"what-changed":"The module contains 2 functions with similar structure: Handle_NoneMode_NoExplicitUrl_LogsWarning,Handle_WithExplicitUrl_DoesNotLogWarning","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":"Log","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":"tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/ApplicationUrlConfigurationNotificationHandlerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":101,"what-changed":"Log 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":"Umbraco-CMS","code-health":9.644832514130508,"version":"3.0","authors":["Andy Butland","kjac"],"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-04-01T06:17:08.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}