{"results":{"result":{"added-files":{"code-health":9.664948006942803,"old-code-health":0.0,"files":[{"file":"src/Umbraco.Cms.Api.Common/Configuration/ConfigureDefaultApiOptions.cs","loc":28,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoOpenApiOptionsBase.cs","loc":72,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/SortTagsAndPathsTransformer.cs","loc":28,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/TagActionsByGroupNameTransformer.cs","loc":42,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/RequireNonNullablePropertiesSchemaTransformer.cs","loc":35,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/MimeTypesTransformer.cs","loc":52,"code-health":9.842730062691357},{"file":"src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoDeliveryHttpJsonOptions.cs","loc":28,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Serialization/ConfigureUmbracoBackofficeHttpJsonOptions.cs","loc":28,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/FixFileReturnTypesTransformer.cs","loc":32,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Common/OpenApi/SortTagsAndPathsTransformerTests.cs","loc":211,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Common/OpenApi/TagActionsByGroupNameTransformerTests.cs","loc":256,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Delivery/OpenApi/ApiKeyTransformerTests.cs","loc":148,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Delivery/OpenApi/MimeTypesTransformerTests.cs","loc":190,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/OpenApi/ResponseHeaderTransformerTests.cs","loc":129,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Common/OpenApi/RequireNonNullablePropertiesSchemaTransformerTests.cs","loc":149,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/OpenApi/BackOfficeSecurityRequirementsTransformerTests.cs","loc":262,"code-health":9.387218218812514},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoOpenApiOptionsBaseTests.cs","loc":48,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Common/OpenApi/UmbracoSchemaIdGeneratorTests.cs","loc":47,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/UmbracoOperationIdTransformer.cs","loc":59,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/OpenApi/OpenApiOptionsExtensions.cs","loc":10,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/OpenApi/Transformers/BackOfficeSecurityRequirementsTransformer.cs","loc":85,"code-health":9.6882083290695},{"file":"src/Umbraco.Cms.Api.Management/OpenApi/Transformers/NotificationHeaderTransformer.cs","loc":69,"code-health":9.6882083290695},{"file":"src/Umbraco.Cms.Api.Management/OpenApi/Transformers/ResponseHeaderTransformer.cs","loc":53,"code-health":9.6882083290695},{"file":"src/Umbraco.Cms.Api.Delivery/OpenApi/OpenApiServiceCollectionExtensions.cs","loc":19,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/OpenApi/Transformers/MemberAuthenticationSecurityRequirementsTransformer.cs","loc":41,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/OpenApi/Transformers/ApiKeyTransformer.cs","loc":38,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/OpenApi/Transformers/ContentApiTransformer.cs","loc":127,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/OpenApi/Transformers/DeliveryApiTransformerBase.cs","loc":76,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/OpenApi/Transformers/MediaApiTransformer.cs","loc":73,"code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.Api.Delivery/OpenApi/OpenApiContractTest.cs","loc":19,"code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.Api.Delivery/OpenApi/OpenApiCustomDerivedTypeTest.cs","loc":71,"code-health":9.6882083290695},{"file":"tests/Umbraco.Tests.Integration/Umbraco.Api.Delivery/OpenApi/OpenApiTestBase.cs","loc":102,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/DependencyInjection/OpenApiSchemaServiceExtensions.cs","loc":31,"code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/DependencyInjection/OpenApiServiceCollectionExtensions.cs","loc":24,"code-health":10.0},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Common/DependencyInjection/OpenApiSchemaServiceExtensionsTests.cs","loc":61,"code-health":10.0}]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/21058","old-code-health":9.805397747613636,"modified-files":{"code-health":9.80100567171898,"old-code-health":9.804313008191192,"files":[{"file":"src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs","loc":48,"old-loc":29,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs","loc":137,"old-loc":130,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/DependencyInjection/UmbracoBuilderExtensions.cs","loc":104,"old-loc":100,"code-health":9.516545551848777,"old-code-health":9.53819281396878},{"file":"templates/UmbracoExtension/Composers/UmbracoExtensionApiComposer.cs","loc":34,"old-loc":45,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/UmbracoSchemaIdGenerator.cs","loc":27,"old-loc":31,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Serialization/ConfigureUmbracoBackofficeJsonOptions.cs","loc":35,"old-loc":34,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Infrastructure/Serialization/ContentJsonTypeResolverBase.cs","loc":25,"old-loc":45,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/documents/document-types/property-type/document-type-property-type-reference-response.management-api.mapping.ts","loc":26,"old-loc":26,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/documents/documents/reference/repository/document-reference-response.management-api.mapping.ts","loc":27,"old-loc":27,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/documents/documents/user-permissions/document-property-value/data/from-server.management-api.mapping.ts","loc":30,"old-loc":30,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/documents/documents/user-permissions/document-property-value/data/to-server.management-api.mapping.ts","loc":28,"old-loc":28,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/documents/documents/user-permissions/document/conditions/document-user-permission.condition.ts","loc":98,"old-loc":98,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Web.UI.Client/src/packages/documents/documents/user-permissions/document/utils.ts","loc":4,"old-loc":4,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/media/imaging/types.ts","loc":12,"old-loc":12,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/media/media-types/property-type/media-type-property-type-reference-response.management-api.mapping.ts","loc":26,"old-loc":26,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/media/media/reference/repository/media-reference-response.management-api.mapping.ts","loc":31,"old-loc":31,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/members/member-type/property-type/member-type-property-type-reference-response.management-api.mapping.ts","loc":26,"old-loc":26,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/members/member/reference/repository/member-reference-response.management-api.mapping.ts","loc":30,"old-loc":30,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/relations/relations/utils.ts","loc":19,"old-loc":19,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-picker/media-picker.tiptap-toolbar-api.ts","loc":161,"old-loc":161,"code-health":8.598774368581582,"old-code-health":8.598774368581582},{"file":"src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs","loc":37,"old-loc":37,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ExportDocumentTypeController.cs","loc":42,"old-loc":41,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/MediaType/ExportMediaTypeController.cs","loc":42,"old-loc":41,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DownloadCreatedPackageController.cs","loc":51,"old-loc":51,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/ManagementApiControllerBase.cs","loc":63,"old-loc":64,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Common/OpenApi/OpenApiRouteTemplatePipelineFilter.cs","loc":45,"old-loc":55,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoDeliveryApiOpenApiOptions.cs","loc":25,"old-loc":27,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Configuration/ConfigureUmbracoManagementApiOpenApiOptions.cs","loc":25,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/ManagementApi/ManagementApiTest.cs","loc":196,"old-loc":197,"code-health":9.096655465156704,"old-code-health":9.096655465156704},{"file":"tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs","loc":272,"old-loc":270,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs","loc":188,"old-loc":187,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTestsBase.cs","loc":13,"old-loc":13,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Delivery/Controllers/DeliveryApiControllerBase.cs","loc":27,"old-loc":27,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/FileSystemManagementControllerBase.cs","loc":13,"old-loc":13,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/DependencyInjection/ApplicationBuilderExtensions.cs","loc":56,"old-loc":63,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.Common/ApplicationBuilder/UmbracoApplicationBuilder.cs","loc":128,"old-loc":120,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.Common/ApplicationBuilder/UmbracoPipelineFilter.cs","loc":44,"old-loc":34,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"tests/Umbraco.TestData/Extensions/UmbracoBuilderExtensions.cs","loc":53,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs","loc":227,"old-loc":227,"code-health":9.842730062691357,"old-code-health":9.842730062691357},{"file":"src/Umbraco.Web.Common/Profiler/ConfigureMiniProfilerOptions.cs","loc":44,"old-loc":44,"code-health":10.0,"old-code-health":10.0},{"file":"tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs","loc":66,"old-loc":50,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/elements/reference/repository/element-reference-response.management-api.mapping.ts","loc":28,"old-loc":28,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Cms.Api.Management/Controllers/Document/PatchDocumentController.cs","loc":65,"old-loc":64,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":10.0,"files":[{"file":"src/Umbraco.Web.Common/ApplicationBuilder/IUmbracoPipelineFilter.cs","loc":0,"old-loc":15,"old-code-health":10.0}]},"external-review-id":"21058","analysis-time":"2026-04-30T18:30:30Z","negative-impact-count":13,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["6e2413bb9c733dcd3b62bf64a40731bc6101a5ea","5b035ff1b0a913a017b015bf479c52361c0eb446","ad9393cca90addccf70e5378875077a3b6376d13","fbd358d9d0d1037704ac4310291764936c9f72a8","9449564f776ed32dc4c7211793fdecf6356fe4af","f04cd943c75e850b22e14fff007e4a29ab8485cb","8a32af3b6c49892b99938b90d8c170330997d878","e954aeb414b1dcece8c1a6d65d6c6be606bb4158","4dee734d64f944ffd7f21fb4864dc1384400b6c1","a29faae9e8cf6d3760fb4e1f1f75b3da705f011c","e6caf6ed5924d36d04b6cbd873a157695417a140","902bbad5f9b5448e2d886b3b052811ed740aadc7","7011f39e6b50ccc8ef740008b2c8eceb2809d215","1c70f547a437e3e2bd9059c950dd827adb7094e9","6574d58a7ee7df766ea5edbc0cc447556c79bac6","d9f82e98da6bbcb290b7195238f162c25e69465f","d32628bd62534f9e03d64b067993fd94d6514193","271f698aa865254cbbddcec3d9b151e4b31ebc98","90e242269a8628cedea76add473ae1b10cf2a153","fa343546828b682dc270aa7189b4d0fc9aa87110","6fed9667e2ee7453f46f2eb4d6f06dfcfd718284","fc36c5f5f8373d85350705fc209972ddb8f16ce8","f9f358a9affddbace8de673d618514f8afc1809e","5ca396530dbc17458850b34cac736d22fd694248","1c4f78d08f10eafcc31022a9f1d4d7554d0d7789","4d3ab86e025fe67d476c2a8166545f8d2f096b49","658310664c3fafc95a9418429e027eec69ddad40","62ee66371d88ec9437d71064a835853896951cf2","91df6e29334616085ed8914efb993f31dc6176be","28a2df9539f296fb9dd0cc2dc11afbf9c172aca0","09a0c9e609aa241674f7eea022d43fe91df0f233","aa717d068c82871c59a7e9d54fe6c1a2e1ee553f","ed65b95107a667493b6b73d8a67674c0308d8744","a95b6fddf14b93644fdd98f8cfdc202a36a9b155","ba003c0e096bc98cd8de5019330ebfb05aabe42e","5d3abf7c51d6a941d33ca2d713176ab0ab610de3","7a2cd3647a862a9ecb89e83067e1c0309210014e","1e85671c796e104e262bc68ff6f95898dffe6528","31c6808af2c68b2c67fe7f8e6fa17648235ae736","c8c1d6f0fbbebae97ff64c6415bea677dbaea957","3ad75dd23525ff0bde7021e6131ec43bfc02963f","9834cb044dad39a998611e36637930e7591cf85b","ea31004ab72603c72c9f38b0314629668a2e0cf8","ed217bac39b809e3c35b1197cbeb7f0a432e9e32","bf7d054170f8c15c73894702ab9557ae1d5019d1","2da7a6d13e74f0b5d7ede124b84454e70bb14486","70de857f1d0b8bab64177057eea06b02a276245d","cdb6c679e636b18ba3117e4422515020630704c7","4849df7089fd4b759bf4f4fb0d764dba742d9f35","0d54cfafa25ae44001460e2411f12e34e2be09c5","82a7dbb0325e76f7172edefe6f5a36f9df6e3718","32265b47fb6342164c88a5ea39f2c580062e9ea1","b215c2a46357cdefb6c606c56872e923d96f9ad7","e3e69f4152df1e455665e74f04a8d03ceee54bba","4e911a7c4385501c76fa7e40cc02cea81eae4a1b","4172e9aa94756e846ae2505713b3d527115703c8","8d2791321081d417316fd2c2c4004d53cd999a40","b5231d03ef71bde64ccc3ebaebf8153611c3f828","2983f1323332c0db00decf1048c7f8c2e6480111","f874a80d04babd3412f5e1ba1fdf8399160082e2","685f680207cca221e72e70d104308ca1abdaa07a","09fa158284438ab5c4a72cdcdfb2872b51964717","b0f4900ac5158a7297918f6e29882c826c5f7730","30326bf368319ac0aca32621128c21e0d080a0a5","f9b3ac0166728ccc43cc9f94010472df0e8b0f2a","2754cea6494d8dd47fd2ee332684cb604743039c","65f914d5b9a160b1adbea8d9489cb2885d1b81ae","42483ced455086c9d376cf7e644cd2211eb30b6f","5ea01b08c632f330e7524300088360381230703f","008ebafa8f5d063229cc80404f4936d0a0d1de95","aaea0407f169c9b3971638bf16a7cf864263e06a","dc27bef21f49f1944ea37030f27d317067957f1e","49a2eba49972f533a5a75cbd288eb9490e86640a","b23c69f32dfca987d00822a9714cc4c3dedee2a5","f97ad76258e176adf2c3c1b84159ab4c31f2b676","146f8cdb4530e62d9231bf9abb955ccb56a855c7","a6ab23f7871e06418ea4f4017d5e18ad4c0b7c5d","a85a426d06fe8e8c84087108ea43f0b1b138e2cd","67ef8db76bb208b53292b09c7b06b0952d675376","0c1b1e2f9492f7376eac830b528b6887e07e5a4f","5492ae08d092bddec965132668dbdcf66999df3b","9f780e5e2a1874d52e718e394e3a32e575a8acee","9f3feacea6b8edecefa484cdbaa52407836a0e95","a207d81ed0d2d9bc65d1b434a2994179dfe934af","9348449c32a68b487daf6b52e2797a0008faa30c","950fbbf0fdd9a87377057e2c7c3f2af0de8f29ce","94e665bdc105088b0d01ce5538af730e054f8192","898d1bf906637363003c8462565e35c508a67e52","0f0adcec6b4b950abef24cc8bef86f6e600991ec","4036c9734dc01a1385aa01cb72b8a21419893b6c","fbc8d19b79e7cc10fa4ef555a5624f797deb4257","b068e75ca89ed659f21eb36aa3ad7015e33292d3","a8f09f580d09e228cc0d21bdadf10a1bb17bd37f","74858e2769b98db89d1bc126b93fd0f981024cf8","59087d28f145ffc93eb5e78c8ec079b4fcaf73c6","17c4c38028af2004f3b7709ae27035575479f9d1","2ebd54867b4c9616a174d9c4a86f10214e524855","114c7eeb95d7cdb36f7dc5ddd1e42088240ab646","b67ebe30a344c42bab21bb8552b13a382162dcb5","f38eafd0f636f03855f3bf92949ba35e2a2e39bf","b89e350974a99ca002549c55a76beeafc044bf28","82dae439ddb43dbb56d4b40722419569ac60745d","d24e2c0ea916f652cf6cd5a6661a7b8a0628850d","fc9fb40bd7170cf42091483c66a9594031e3303f","fe82e8956185bff39af0d2055c110270dc1e8147","435f541c94b9cb5f48956aebfcfd84f55a4db038","fada67261ee87040936ebe80cde8895296963564","303eacfb31afa8814608cd6d9e4f58f5e5a6feb2","cdb41dbd8393efd8f85422dc63fd41fa587fad4b","ef9778da33da353f73ead8e7ba942b3c31ab7360","72944067785a47365653c3dcbec4a1e13235cbf9","5a546684b19995a6f724e5f28c37888876ca07ee","5752d5ba0f5a0ce554cd7c5cbf238c45343bbe40","69d9afd5f1aa6132c3cf9601cf8dcb51918c6ecd","e74d55e8fb5b21817835e1b54240a86f4f6954b0","3d31f6fb39293e70786d8c88ccff521332df49c3","d0ad10d14208e3d56ac6e7f3fa03c9b4e682014b","31d99323412c58b81a6fee73100b084cfeace451"],"is-negative-review":true,"negative-findings":{"number-of-types":7,"number-of-files-touched":13,"findings":[{"method":"AddUmbracoManagementApi","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/DependencyInjection/UmbracoBuilderExtensions.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":25,"what-changed":"AddUmbracoManagementApi increases from 83 to 87 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"},{"method":"TransformAsync","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.Cms.Api.Common/OpenApi/MimeTypesTransformer.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":16,"what-changed":"TransformAsync has 2 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"},{"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.Cms.Api.Common/OpenApi/SortTagsAndPathsTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":15,"what-changed":"The module contains 2 functions with similar structure: TransformAsync_Sorts_Tags_Alphabetically,TransformAsync_Sorts_Tags_Case_Sensitive","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.Cms.Api.Common/OpenApi/TagActionsByGroupNameTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":25,"what-changed":"The module contains 6 functions with similar structure: TransformAsync_Document_Handles_Null_Operations,TransformAsync_Document_Handles_Operations_Without_Tags,TransformAsync_Operation_Adds_Tag_To_Document_When_Not_Present,TransformAsync_Operation_Does_Not_Duplicate_Tag_In_Document and 2 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":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Delivery/OpenApi/ApiKeyTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":61,"what-changed":"The module contains 5 functions with similar structure: TransformAsync_Document_Preserves_Existing_Components,TransformAsync_Document_Preserves_Existing_Security_Schemes,TransformAsync_Operation_Adds_Security_Requirement,TransformAsync_Operation_Preserves_Existing_Security 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":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Delivery/OpenApi/MimeTypesTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":19,"what-changed":"The module contains 6 functions with similar structure: TransformAsync_Consumes_Preserves_Schema_From_Existing_Entry,TransformAsync_Consumes_With_Multiple_ContentTypes_Keeps_All_Declared,TransformAsync_Keeps_Only_Consumes_ContentTypes_For_RequestBody,TransformAsync_Preserves_All_MimeTypes_When_Json_Not_Present and 2 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":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/OpenApi/ResponseHeaderTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":18,"what-changed":"The module contains 2 functions with similar structure: TransformAsync_Adds_GeneratedResource_Header_For_201_Response,TransformAsync_Adds_Location_Header_For_201_Response","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.Cms.Api.Common/OpenApi/RequireNonNullablePropertiesSchemaTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":40,"what-changed":"The module contains 5 functions with similar structure: TransformAsync_Adds_NonNullable_Properties_To_Required,TransformAsync_Does_Not_Duplicate_Already_Required_Properties,TransformAsync_Skips_Nullable_Properties,TransformAsync_Skips_Nullable_Schema_Type_For_Unknown_Properties 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":"tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/OpenApi/BackOfficeSecurityRequirementsTransformerTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":111,"what-changed":"The module contains 6 functions with similar structure: TransformAsync_Operation_Adds_401_Response_For_Authorized_Endpoints,TransformAsync_Operation_Adds_403_Response_For_Controller_With_IAuthorizationService_Injection,TransformAsync_Operation_Adds_403_Response_For_Multiple_Authorize_Attributes,TransformAsync_Operation_Adds_Security_Requirement_For_Authorized_Endpoints and 2 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"},{"method":"TransformAsync","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.Cms.Api.Management/OpenApi/Transformers/BackOfficeSecurityRequirementsTransformer.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":29,"what-changed":"TransformAsync 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":"TransformAsync","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.Cms.Api.Management/OpenApi/Transformers/NotificationHeaderTransformer.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":17,"what-changed":"TransformAsync has a cyclomatic complexity of 9, 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":"SetHeader","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.Cms.Api.Management/OpenApi/Transformers/ResponseHeaderTransformer.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":52,"what-changed":"SetHeader 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"},{"method":"CustomApiContentResponse","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":"tests/Umbraco.Tests.Integration/Umbraco.Api.Delivery/OpenApi/OpenApiCustomDerivedTypeTest.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":70,"what-changed":"CustomApiContentResponse has 8 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"}]},"positive-impact-count":0,"repo":"Umbraco-CMS","code-health":9.73216114589698,"version":"3.0","authors":["Laura Neto","Andy Butland"],"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-30T18:30:29.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}