Fixes issues with creation of documents from blueprints that have populated file upload properties - #19655
CodeScene PR Check
Quality Gate Failed
Code Health Improved
(1 files improve in Code Health)
Gates Failed
Enforce critical code health rules
(1 file with Bumpy Road Ahead)
Enforce advisory code health rules
(3 files with Large Method, Complex Method, Complex Conditional)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| FileUploadContentDeletedNotificationHandler.cs | 1 critical rule | 10.00 → 8.56 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| FileUploadContentDeletedNotificationHandler.cs | 2 advisory rules | 10.00 → 8.56 | Suppress |
| UmbracoBuilder.CoreServices.cs | 1 advisory rule | 8.87 → 8.85 | Suppress |
| FileUploadContentCopiedOrScaffoldedNotificationHandler.cs | 1 advisory rule | 7.32 → 8.26 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| FileUploadContentCopiedOrScaffoldedNotificationHandler.cs | 7.32 → 8.26 | Code Duplication, Overall Code Complexity |
| ContentBlueprintEditingService.cs | no change | Primitive Obsession |
| ContentService.cs | no change | Overall Code Complexity, Primitive Obsession |
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):
- Complex Conditional FileUploadContentDeletedNotificationHandler.cs: GetPathsFromUploadFieldProperty
- Large Method UmbracoBuilder.CoreServices.cs: AddCoreNotifications
- Complex Method FileUploadContentDeletedNotificationHandler.cs: GetPathsFromBlockValue
- Complex Method FileUploadContentCopiedOrScaffoldedNotificationHandler.cs: Handle
- Complex Method FileUploadContentDeletedNotificationHandler.cs: ContainedFilePaths
- Bumpy Road Ahead FileUploadContentDeletedNotificationHandler.cs: GetPathsFromBlockValue
✅ Improving Code Health:
- Overall Code Complexity ContentService.cs 🔥
- Primitive Obsession ContentBlueprintEditingService.cs
- Primitive Obsession ContentService.cs 🔥
- Code Duplication FileUploadContentCopiedOrScaffoldedNotificationHandler.cs
- Overall Code Complexity FileUploadContentCopiedOrScaffoldedNotificationHandler.cs
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
AddCoreNotifications increases from 93 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Code Duplication
The module no longer contains too many functions with similar structure
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
Handle increases in cyclomatic complexity from 11 to 12, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Overall Code Complexity
The mean cyclomatic complexity in this module is no longer above the threshold
Check notice on line 1 in src/Umbraco.Core/Services/ContentBlueprintEditingService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 55.77% to 54.72%, 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/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.10 to 4.07, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
Check notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 46.71% to 46.58%, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
GetPathsFromBlockValue has a cyclomatic complexity of 17, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
ContainedFilePaths has a cyclomatic complexity of 10, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
GetPathsFromUploadFieldProperty has 2 complex conditionals with 4 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
GetPathsFromBlockValue has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block 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.