Skip to content

Content Types: Allow editing compositions on document types that are inherited from (closes #23103) - #23433

Merged
AndyButland merged 10 commits into
v17/devfrom
v17/bugfix/23103-compositions-locked-by-inheritance
Aug 24, 2026
Merged

AndyButland merged 10 commits into
v17/devfrom
v17/bugfix/23103-compositions-locked-by-inheritance

Merge branch 'v17/dev' into v17/bugfix/23103-compositions-locked-by-i…

fb222d3
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Code Health Review (v17/dev) failed Aug 24, 2026 in 1m 16s

CodeScene PR Check

Quality Gate Failed

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

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce critical code health rules Violations Code Health Impact
ContentTypeEditingServiceTests.Update.cs 1 critical rule 4.90 → 4.64 Suppress
Enforce advisory code health rules Violations Code Health Impact
ContentTypeServiceBase{TRepository,TItem}.cs 1 advisory rule 6.72 → 6.70 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):

  • Low Cohesion ContentTypeEditingServiceTests.Update.cs
  • Complex Method ContentTypeServiceBase{TRepository,TItem}.cs: ComposeContentTypeChanges

✅ Improving Code Health:

  • Code Duplication ContentTypeEditingServiceTests.Update.cs: Cannot_Add_Compositions_For_Content_Type_With_Children
  • Code Duplication ContentTypeServiceExtensionsTests.cs: GetAvailableCompositeContentTypes_No_Results_If_Already_A_Composition_By_Parent

Annotations

Check warning on line 1 in tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Update.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (v17/dev)

❌ Getting worse: Low Cohesion

The number of different responsibilities increases from 14 to 15, threshold = 3

Cohesion is calculated using the LCOM4 metric. Low cohesion means that the module/class has multiple
unrelated responsibilities, doing too many things and breaking the Single Responsibility Principle.

Check notice on line 1 in tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Update.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (v17/dev)

✅ Getting better: Code Duplication

reduced similar code in: Cannot_Add_Compositions_For_Content_Type_With_Children

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/Services/ContentTypeServiceExtensionsTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (v17/dev)

✅ Getting better: Code Duplication

reduced similar code in: GetAvailableCompositeContentTypes_No_Results_If_Already_A_Composition_By_Parent

Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 442 in src/Umbraco.Core/Services/ContentTypeServiceBase{TRepository,TItem}.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (v17/dev)

❌ Getting worse: Complex Method

ComposeContentTypeChanges increases in cyclomatic complexity from 26 to 27, 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.