Skip to content

Add support for UrlMode parameter in HtmlLocalLinkParser (port of #20…

784f546
Select commit
Loading
Failed to load commit list.
Merged

Link rendering: Add support for UrlMode parameter in HtmlLocalLinkParser (port to 16) #20207

Add support for UrlMode parameter in HtmlLocalLinkParser (port of #20…
784f546
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Sep 20, 2025 in 37s

CodeScene PR Check

Quality Gate Failed

Gates Failed
Enforce advisory code health rules (2 files with Primitive Obsession, Code Duplication, Large Method)

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce advisory code health rules Violations Code Health Impact
HtmlLocalLinkParserTests.cs 2 advisory rules 9.59 → 8.86 Suppress
HtmlLocalLinkParser.cs 1 advisory rule 9.54 → 9.24 Suppress

Absence of Expected Change Pattern

  • Umbraco-CMS/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs is usually changed with: Umbraco-CMS/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlImageSourceParserTests.cs

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Details

🚩 Declining Code Health (highest to lowest):

  • Code Duplication HtmlLocalLinkParserTests.cs
  • Large Method HtmlLocalLinkParserTests.cs: ParseLocalLinks_WithVariousUrlModes_ReturnsCorrectUrls
  • Primitive Obsession HtmlLocalLinkParser.cs

✅ Improving Code Health:

  • String Heavy Function Arguments HtmlLocalLinkParser.cs
  • Large Method HtmlLocalLinkParserTests.cs: ParseLocalLinks

Annotations

Check warning on line 1 in src/Umbraco.Core/Templates/HtmlLocalLinkParser.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Primitive Obsession

In this module, 78.6% of all function arguments are primitive types, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.

Check notice on line 1 in src/Umbraco.Core/Templates/HtmlLocalLinkParser.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: String Heavy Function Arguments

The ratio of strings in function arguments decreases from 66.67% to 64.29%, threshold = 39.0%. The functions in this file have a high ratio of strings as arguments. Avoid adding more.

Check warning on line 1 in tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Code Duplication

The module contains 2 functions with similar structure: Returns_Udis_From_Legacy_LocalLinks,Returns_Udis_From_LocalLinks. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check notice on line 1 in tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

✅ No longer an issue: Large Method

ParseLocalLinks is no longer above the threshold for lines of code. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.

Check warning on line 433 in tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Large Method

ParseLocalLinks_WithVariousUrlModes_ReturnsCorrectUrls has 103 lines, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.