Skip to content

Elements: Fix UdiEntityTypeHelper.ToUmbracoObjectType() for Element entities#22874

Merged
AndyButland merged 2 commits into
release/18.0from
v18/hotfix/toumbracoobjecttype
May 19, 2026
Merged

Elements: Fix UdiEntityTypeHelper.ToUmbracoObjectType() for Element entities#22874
AndyButland merged 2 commits into
release/18.0from
v18/hotfix/toumbracoobjecttype

Remove UdiEntityTypeHelperTests

6c91e8c
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Code Health Review (release/18.0) failed May 18, 2026 in 36s

CodeScene PR Check

Quality Gate Failed

Gates Failed
Enforce advisory code health rules (1 file with Complex Method)

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce advisory code health rules Violations Code Health Impact
UdiEntityTypeHelper.cs 1 advisory rule 8.90 → 8.85 Suppress

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method UdiEntityTypeHelper.cs: ToUmbracoObjectType

Annotations

Check warning on line 117 in src/Umbraco.Core/UdiEntityTypeHelper.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (release/18.0)

❌ Getting worse: Complex Method

ToUmbracoObjectType increases in cyclomatic complexity from 19 to 21, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.