{"results":{"result":{"added-files":{"code-health":10.0,"old-code-health":0.0,"files":[{"file":"src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-view.context.ts","loc":11,"code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/examples/workspace-view-hint/hint-workspace-view.ts","loc":50,"code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/hint/context/hints.context.ts","loc":14,"code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/hint/context/hints.controller.ts","loc":163,"code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/view/context/view.context.ts","loc":59,"code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.context.ts","loc":58,"code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/content-validation-to-hints.manager.ts","loc":73,"code-health":10.0}]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/19255","old-code-health":8.817111254024864,"modified-files":{"code-health":8.809347501202316,"old-code-health":8.817111254024864,"files":[{"file":"src/Umbraco.Web.UI.Client/src/packages/core/menu/menu-tree-structure-workspace-context-base.ts","loc":103,"old-loc":103,"code-health":9.500346130021617,"old-code-health":9.500346130021617},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts","loc":236,"old-loc":168,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/libs/observable-api/states/array-state.test.ts","loc":192,"old-loc":186,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Web.UI.Client/src/libs/observable-api/states/array-state.ts","loc":114,"old-loc":111,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/content-detail-workspace-base.ts","loc":690,"old-loc":681,"code-health":8.149131720230493,"old-code-health":8.176406410475257},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.context.ts","loc":105,"old-loc":87,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts","loc":111,"old-loc":100,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/core/validation/context/validation.context.ts","loc":18,"old-loc":18,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts","loc":196,"old-loc":156,"code-health":10.0,"old-code-health":10.0},{"file":"src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.ts","loc":381,"old-loc":381,"code-health":9.056219954502149,"old-code-health":9.056219954502149},{"file":"src/Umbraco.Web.UI.Client/src/packages/content/content-type/structure/content-type-structure-manager.class.ts","loc":753,"old-loc":670,"code-health":7.836073113318749,"old-code-health":8.081397647201445},{"file":"src/Umbraco.Web.UI.Client/src/packages/content/content-type/structure/content-type-property-structure-helper.class.ts","loc":98,"old-loc":178,"code-health":9.6882083290695,"old-code-health":8.816158827775617}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"19255","analysis-time":"2025-08-22T10:56:55Z","negative-impact-count":2,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":1,"commits":["207c72f67b44ae96eb7b9bdc97b7b9dbf5372e78","78b3d76738869185ad1f7336386ed053c4942dc1","af40088b41223d49b3f6ed4c19e617632705cb91","982c6b95c5133bd1aaf641d212b3d3d2c09bd10d","7365fc7088487884b0050d5cf2e6653e400517b1","d482a21537e974ff99b810e90e2673c9a26ed4b1","b492203948e175324b567889a779ddc8a863a75b","7724575a838ebdc8429f8733c6fd8d7e7e7672fc","5d2aab75435688f933b8814c3844ee424f8b21e4","77d546ccbbc61cbf54293bf583178438af38b909","e2d8c13b6b231fbda2d8460c181620f5a5e37b79","55c8a086c5def7cd2cc8c2da63346b4da847d51f","62013f2e797a5cbfd61470b985d51de7c79f937b","dd83e8420d6b763a97892a96c464efe2b50ca2a9","4642e0e32b09b5b1d6cfd8fe29121c283d5029a6","5f59f4b0cffbdca5e9b862468932ca3cba2c0f2e","1ba948e6becd2ae4d26aac01b2b219f796c7a75f","97533a4d488a7ee71768b5901026399326a83020","adfda51694fa66c42afa45c9f7cad80f9df39c04","61ceb57ea4cc883a1ac4540f0cee4b67f2c9d580","ff46b18648b9586966d15a5cbd8d8a35baf5cfbe","fa5067c37f4302b2e17338c1af7296e28d21a2b5","47f03e285b36a647cb986b521db2b36b3b02c7fe","42f6863f88e93f467e6ac93ccd5870d5fc14fe56","0408fa05f1ed5ff9c1d6bc8284e8b965984fc7fc","536069aa656133a955d3feb694ac354547f90848","bebc5ec0ba2a3bc8ed7f8d2db5efeb9b2c9a4c1a","9b6a242f5d99d5c7582d62c0cc3f8c0929f5f491","843b889a6708461d550ec6b1a50f37ed795aea86","26cd5199fb9d05da8dd3876e6d0f3e84e8f3f9ed","4b16be5e5dd95d9afbb2c255a8274a8ab37ca1cf","0758e5f99f66455dab7dfe757af9ce87f413d30c","45a64fa1579bab960d3175b13e723aa703cea9fa","613aae7061e76620660cacbd012966152b8c78b0","1d48d6ab08c5aff71c8878fced3e4ec6011accf4","421af86866aef03f20c299439fd0cac7531b0937","2ce17d320eb673b07d00fb3d2bfe70b8bcf09f03","09367685f621ab148f7594a951ac07e3ba978aa6","4c15a854a352f6d25d5b22a6ed39beaa148e77d8","d6395d013ae3db82af47254141edbb8c964d04f5","4c1df67804b4731ca105065624c18759d2d5f30c","de765be3cc6e49870f1c5bf9d0d1aa6370e2ecd6","3b07192e1c3aa6872b973657486000e07025801a","c2752794f91844092bcf902354f5e1fbadcc126e","819111154d74981e1213dd5e90682744dc36f6bd","db1d91d9a899f15bfac7381482759c2e9b810dcd","14292f12b17487021dd747a44a87b0aeca1bd828","bb934d9c8d8b295cd2fd671bdae8c9085bbff81f","915eeb05ca58dcc6bae6e56268bdd38febb8b441","ae465503e9d7e4785711c36bdb367e15724a7e83","34d6a1ad2d4c5ab81c45ec47d0749b405628f0e0","240dc3634c52518b12e6c53451c39046b080c19e","de7689d08e9cb558e9d2cb64e0ed12c54ac89e66","b395af88be00816a3c674514016d18bf99ae5d0d","01885d0a409d8d2cd65c4ab76ec7727d01654be9","da63fc989ef7668ae87c2c28d92259280f6cbacc","982a811326f8a74ce52df0b0e1c2c4752d2c0406","752afb0543e6882c87ac59d1262daa1d0c6b0847","c3a2f917ef8284b86ba51bc03df21bdf51c111de","8c98c38d8641c35ffa9210b918f02f94507ea4bb","a5a4a5aae71309eabfec054cd7d99ddfcc2a4abf"],"is-negative-review":true,"negative-findings":{"number-of-types":2,"number-of-files-touched":2,"findings":[{"method":"constructor","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the TypeScript language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/content-detail-workspace-base.ts","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":"typescript","improvement-type":"Complex Method"}],"change-level":"warning","is-hotspot?":false,"line":182,"what-changed":"constructor already has high cyclomatic complexity, and now it increases in Lines of Code from 154 to 160","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"},{"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.Web.UI.Client/src/packages/content/content-type/structure/content-type-structure-manager.class.ts","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":724,"what-changed":"introduced similar code in: UmbContentTypeStructureManager.propertyStructuresOf,UmbContentTypeStructureManager.propertyStructuresOfGroupIds","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"}]},"positive-impact-count":4,"repo":"Umbraco-CMS","code-health":8.958135609081268,"version":"3.0","authors":["Niels Lyngsø"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":4,"number-of-files-touched":3,"findings":[{"method":"UmbWorkspaceSplitViewContext._observeVariant","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the TypeScript language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.context.ts","change-level":"improvement","is-hotspot?":false,"line":54,"what-changed":"UmbWorkspaceSplitViewContext._observeVariant is no longer above the threshold for cyclomatic complexity","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":"fixed"},{"name":"Primitive Obsession","file":"src/Umbraco.Web.UI.Client/src/packages/content/content-type/structure/content-type-structure-manager.class.ts","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, 33 % 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 34.33% to 33.33%, threshold = 30.0%"},{"method":"UmbContentTypePropertyStructureHelper.observeSimilarContainers","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.Web.UI.Client/src/packages/content/content-type/structure/content-type-property-structure-helper.class.ts","change-level":"improvement","is-hotspot?":false,"line":132,"what-changed":"UmbContentTypePropertyStructureHelper.observeSimilarContainers 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":"UmbContentTypePropertyStructureHelper.observeContainers","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 TypeScript language is  levels of nesting.","name":"Deep, Nested Complexity","file":"src/Umbraco.Web.UI.Client/src/packages/content/content-type/structure/content-type-property-structure-helper.class.ts","change-level":"improvement","is-hotspot?":false,"line":77,"what-changed":"UmbContentTypePropertyStructureHelper.observeContainers is no longer above the threshold for nested complexity depth","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":"fixed"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2025-08-22T10:56:54.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}