Skip to content

Publishing: Validate segment values on scheduled publish, publish with descendants and create/update-and-publish (closes #24558) - #24559

Merged
Zeegaan merged 3 commits into
v19/devfrom
v19/bugfix/24558-validate-segment-values-on-publish
Nov 14, 2026
Merged

Zeegaan merged 3 commits into
v19/devfrom
v19/bugfix/24558-validate-segment-values-on-publish

Validate invalid segment values with * culture context

3fefbb5
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Code Health Review (v19/dev) failed Nov 12, 2026 in 54s

CodeScene PR Check

Quality Gate Failed

Gates Failed
Enforce critical code health rules (2 files with Bumpy Road Ahead, Low Cohesion)
Enforce advisory code health rules (2 files with Complex Method, Primitive Obsession)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce critical code health rules Violations Code Health Impact
PropertyValidationService.cs 1 critical rule 7.00 → 6.61 Suppress
BlockListElementLevelVariationTests.Validation.cs 1 critical rule 5.40 → 5.10 Suppress
Enforce advisory code health rules Violations Code Health Impact
PropertyValidationService.cs 1 advisory rule 7.00 → 6.61 Suppress
ContentPublishingServiceTests.Publish.cs 1 advisory rule no change 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 BlockListElementLevelVariationTests.Validation.cs
  • Primitive Obsession ContentPublishingServiceTests.Publish.cs
  • Complex Method PropertyValidationService.cs: HasInvalidSegmentValue
  • Bumpy Road Ahead PropertyValidationService.cs: HasInvalidSegmentValue
  • Complex Method PropertyValidationService.cs: IsPropertyDataValid

✅ Improving Code Health:

  • String Heavy Function Arguments ContentPublishingServiceTests.Publish.cs

Annotations

Check warning on line 148 in src/Umbraco.Core/Services/PropertyValidationService.cs

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

IsPropertyDataValid increases in cyclomatic complexity from 10 to 11, 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 warning on line 251 in src/Umbraco.Core/Services/PropertyValidationService.cs

See this annotation in the file changed.

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

❌ New issue: Complex Method

HasInvalidSegmentValue has a cyclomatic complexity of 16, 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 warning on line 251 in src/Umbraco.Core/Services/PropertyValidationService.cs

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

HasInvalidSegmentValue has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered.
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 warning on line 1 in tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentPublishingServiceTests.Publish.cs

See this annotation in the file changed.

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

❌ New issue: Primitive Obsession

In this module, 61.1% 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 tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentPublishingServiceTests.Publish.cs

See this annotation in the file changed.

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

✅ No longer an issue: String Heavy Function Arguments

The ratio of strings in function arguments is no longer above the threshold

Check warning on line 1 in tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.Validation.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Code Health Review (v19/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.