{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/20207","old-code-health":9.238954924740296,"modified-files":{"code-health":8.90979661866769,"old-code-health":9.238954924740296,"files":[{"file":"src/Umbraco.Core/PropertyEditors/TextStringValueConverter.cs","loc":44,"old-loc":44,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Core/Templates/HtmlLocalLinkParser.cs","loc":122,"old-loc":119,"code-health":9.240656298427343,"old-code-health":9.536386775820924},{"file":"src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs","loc":50,"old-loc":50,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RteBlockRenderingValueConverter.cs","loc":187,"old-loc":187,"code-health":8.413528317237752,"old-code-health":8.413528317237752},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs","loc":389,"old-loc":217,"code-health":8.856497365862934,"old-code-health":9.592551999935852}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"20207","analysis-time":"2025-09-20T11:23:25Z","negative-impact-count":3,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["784f546329ff037432a18cbce5894fe48790e2d1"],"is-negative-review":true,"negative-findings":{"number-of-types":3,"number-of-files-touched":2,"findings":[{"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, 79 % of all functions have primitive types as arguments.","name":"Primitive Obsession","file":"src/Umbraco.Core/Templates/HtmlLocalLinkParser.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, 78.6% 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"},{"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/Templates/HtmlLocalLinkParserTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":23,"what-changed":"The module contains 2 functions with similar structure: Returns_Udis_From_Legacy_LocalLinks,Returns_Udis_From_LocalLinks","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":"ParseLocalLinks_WithVariousUrlModes_ReturnsCorrectUrls","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.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":320,"what-changed":"ParseLocalLinks_WithVariousUrlModes_ReturnsCorrectUrls has 103 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"}]},"positive-impact-count":2,"repo":"Umbraco-CMS","code-health":8.90979661866769,"version":"3.0","authors":["Andy Butland"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":2,"number-of-files-touched":2,"findings":[{"name":"String Heavy Function Arguments","file":"src/Umbraco.Core/Templates/HtmlLocalLinkParser.cs","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"String is a generic type that fail to capture the constraints of the domain object it represents. In this module, 64 % of all function arguments are string types.","how-to-fix":"Heavy string usage indicates a missing domain language. Introduce data types that encapsulate the semantics. For example, a user_name is better represented as a constrained User type rather than a pure string, which could be anything.","what-changed":"The ratio of strings in function arguments decreases from 66.67% to 64.29%, threshold = 39.0%"},{"method":"ParseLocalLinks","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.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs","change-level":"improvement","is-hotspot?":false,"line":174,"what-changed":"ParseLocalLinks 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"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2025-09-20T11:23:25.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}