Skip to content

Content Types: Granular content type change types - #22223

Merged
AndyButland merged 9 commits into
v18/devfrom
v18/feature/granular-content-type-change-types
Mar 27, 2026
Merged

Content Types: Granular content type change types#22223
AndyButland merged 9 commits into
v18/devfrom
v18/feature/granular-content-type-change-types

Support change detection for both structural and non-structural chang…

6407382
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Code Health Review (v18/dev) failed Mar 27, 2026 in 55s

CodeScene PR Check

Quality Gate Failed

Code Health Improved (1 files improve in Code Health)

Gates Failed
New code is healthy (1 new file with code health below 8.00)
Enforce advisory code health rules (3 files with Complex Method, Code Duplication, Large Assertion Blocks, Duplicated Assertion Blocks, Large Method)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
New code is healthy Violations Code Health Impact
ContentTypeEditingServiceTests.ChangeTypes.cs 3 rules 7.33 Suppress
Enforce advisory code health rules Violations Code Health Impact
ContentTypeEditingServiceTests.ChangeTypes.cs 3 advisory rules 7.33 Suppress
ContentTypeEditingServiceTests.Update.cs 1 advisory rule 4.90 → 4.90 Suppress
ContentTypeServiceBase{TRepository,TItem}.cs 1 advisory rule 6.34 → 6.63 Suppress
View Improvements
File Code Health Impact Categories Improved
ContentTypeServiceBase{TRepository,TItem}.cs 6.34 → 6.63 Bumpy Road Ahead, Deep, Nested Complexity

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):

  • Duplicated Assertion Blocks ContentTypeEditingServiceTests.ChangeTypes.cs
  • Code Duplication ContentTypeEditingServiceTests.ChangeTypes.cs
  • Large Assertion Blocks ContentTypeEditingServiceTests.ChangeTypes.cs
  • Complex Method ContentTypeServiceBase{TRepository,TItem}.cs: ComposeContentTypeChanges
  • Large Method ContentTypeEditingServiceTests.Update.cs: Can_Move_Properties_To_Another_Container

✅ Improving Code Health:

  • Code Duplication ContentTypeEditingServiceTests.Update.cs
  • Bumpy Road Ahead ContentTypeServiceBase{TRepository,TItem}.cs: ComposeContentTypeChanges
  • Deep, Nested Complexity ContentTypeServiceBase{TRepository,TItem}.cs: ComposeContentTypeChanges

Annotations

Check warning on line 480 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 (v18/dev)

❌ Getting worse: Complex Method

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

Check notice on line 480 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 (v18/dev)

✅ Getting better: Bumpy Road Ahead

ComposeContentTypeChanges decreases from 3 to 2 logical blocks with deeply nested code, threshold is 2 blocks per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.

Check notice on line 480 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 (v18/dev)

✅ No longer an issue: Deep, Nested Complexity

ComposeContentTypeChanges is no longer above the threshold for nested complexity depth

Check warning on line 37 in tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.ChangeTypes.cs

See this annotation in the file changed.

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

❌ New issue: Code Duplication

The module contains 7 functions with similar structure: Add_Property_Emits_PropertyAdded,Change_Alias_Emits_AliasChanged,Change_ContentType_Variation_Emits_VariationChanged_And_RefreshMain,Multiple_Structural_Changes_Emit_Combined_Flags and 3 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 375 in tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.ChangeTypes.cs

See this annotation in the file changed.

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

❌ New issue: Large Assertion Blocks

The test suite contains 4 assertion blocks with at least 4 assertions, threshold = 4. This test file has several blocks of large, consecutive assert statements. Avoid adding more.

Check warning on line 375 in tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.ChangeTypes.cs

See this annotation in the file changed.

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

❌ New issue: Duplicated Assertion Blocks

The test suite contains 13 functions with duplicated assertion blocks (Add_Composition_Emits_CompositionAdded,Add_Property_Emits_PropertyAdded,Change_Alias_Emits_AliasChanged,Change_ContentType_Variation_Emits_VariationChanged_And_RefreshMain and 9 more functions), threshold = 2. This test file has several blocks of duplicated assertion statements. Avoid adding more.

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 (v18/dev)

✅ Getting better: Code Duplication

reduced similar code in: Can_Update_Alias,Can_Update_Variation. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 633 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 (v18/dev)

❌ Getting worse: Large Method

Can_Move_Properties_To_Another_Container increases from 95 to 96 lines of code, 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.