Add support for file upload property editor within the block list and grid #18976
CodeScene PR Check
Quality Gate Failed
Code Health Improved
(3 files improve in Code Health)
Gates Failed
New code is healthy
(2 new files with code health below 9.00)
Enforce critical code health rules
(4 files with Bumpy Road Ahead, Deep, Nested Complexity)
Enforce advisory code health rules
(4 files with Complex Method, Large Method, Primitive Obsession, Code Duplication, Complex Conditional, Overall Code Complexity)
Gates Passed
1 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| New code is healthy | Violations | Code Health Impact | |
|---|---|---|---|
| FileUploadContentCopiedNotificationHandler.cs | 6 rules | 10.00 → 7.32 | Suppress |
| FileUploadEntityDeletedNotificationHandlerBase.cs | 4 rules | 10.00 → 8.05 | Suppress |
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| FileUploadContentCopiedNotificationHandler.cs | 2 critical rules | 10.00 → 7.32 | Suppress |
| FileUploadEntityDeletedNotificationHandlerBase.cs | 1 critical rule | 10.00 → 8.05 | Suppress |
| BlockEditorValidatorBase.cs | 1 critical rule | 8.50 → 8.07 | Suppress |
| FileUploadMediaSavingNotificationHandler.cs | 1 critical rule | 10.00 → 9.84 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| FileUploadContentCopiedNotificationHandler.cs | 4 advisory rules | 10.00 → 7.32 | Suppress |
| FileUploadEntityDeletedNotificationHandlerBase.cs | 3 advisory rules | 10.00 → 8.05 | Suppress |
| BlockListEditorPropertyValueEditorTests.cs | 2 advisory rules | 9.39 → 8.70 | Suppress |
| BlockEditorValidatorBase.cs | 1 advisory rule | 8.50 → 8.07 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| BlockValuePropertyValueEditorBase.cs | 6.54 → 6.95 | Code Duplication, Primitive Obsession |
| FileUploadPropertyValueEditor.cs | 9.02 → 9.31 | Primitive Obsession |
| FileUploadPropertyEditor.cs | 8.41 → 9.39 | Complex Conditional, Bumpy Road Ahead |
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 Method BlockEditorValidatorBase.cs: GetBlockEditorDataValidation
- Code Duplication FileUploadContentCopiedNotificationHandler.cs
- Overall Code Complexity FileUploadContentCopiedNotificationHandler.cs
- Deep, Nested Complexity FileUploadContentCopiedNotificationHandler.cs: UpdateBlockPropertyValues
- Complex Conditional FileUploadEntityDeletedNotificationHandlerBase.cs: GetPathsFromUploadFieldProperty
- Overall Code Complexity FileUploadEntityDeletedNotificationHandlerBase.cs
- Bumpy Road Ahead BlockEditorValidatorBase.cs: GetBlockEditorDataValidation
- Complex Method FileUploadEntityDeletedNotificationHandlerBase.cs: GetPathsFromBlockValue
- Complex Method FileUploadContentCopiedNotificationHandler.cs: UpdateBlockPropertyValues
- Large Method BlockListEditorPropertyValueEditorTests.cs: CreateValueEditor
- Complex Conditional FileUploadContentCopiedNotificationHandler.cs: UpdateUploadFieldProperty
- Primitive Obsession BlockListEditorPropertyValueEditorTests.cs
- Complex Method FileUploadContentCopiedNotificationHandler.cs: Handle
- Complex Method FileUploadEntityDeletedNotificationHandlerBase.cs: ContainedFilePaths
- Bumpy Road Ahead FileUploadContentCopiedNotificationHandler.cs: UpdateBlockPropertyValues
- Bumpy Road Ahead FileUploadEntityDeletedNotificationHandlerBase.cs: GetPathsFromBlockValue
- Bumpy Road Ahead FileUploadMediaSavingNotificationHandler.cs: AutoFillProperties
✅ Improving Code Health:
- Primitive Obsession BlockValuePropertyValueEditorBase.cs
- Complex Conditional FileUploadPropertyEditor.cs: Handle
- Complex Conditional FileUploadPropertyEditor.cs: GetFilePathsFromPropertyValues
- Code Duplication BlockValuePropertyValueEditorBase.cs
- Bumpy Road Ahead FileUploadPropertyEditor.cs: AutoFillProperties
- Primitive Obsession FileUploadPropertyValueEditor.cs
Annotations
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 better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 33.33% to 32.35%, 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)
✅ No longer an issue: Primitive Obsession
The ratio of primivite types in function arguments is no longer above the threshold
Check warning on line 97 in src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValidatorBase.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
GetBlockEditorDataValidation increases in cyclomatic complexity from 24 to 26, 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 97 in src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValidatorBase.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Bumpy Road Ahead
GetBlockEditorDataValidation increases from 4 to 5 logical blocks with deeply nested code, threshold is one single 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
CreateValueEditor has 79 lines, 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)
❌ New issue: Primitive Obsession
In this module, 72.2% 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 63 in src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
Handle no longer has a complex conditional. 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.
Check notice on line 88 in src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
GetFilePathsFromPropertyValues no longer has a complex conditional. 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.
Check notice on line 113 in src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
AutoFillProperties is no longer above the threshold for logical blocks with deeply nested code
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: UpdateBlockEditorData,UpdateBlockEditorData. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
UpdateBlockPropertyValues 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
Handle has a cyclomatic complexity of 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
UpdateUploadFieldProperty has 1 complex conditionals with 2 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
UpdateBlockPropertyValues 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.50 across 12 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
UpdateBlockPropertyValues has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.78 across 9 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
AutoFillProperties 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.