Member types: Implement containers #20706
CodeScene PR Check
Quality Gate Failed
Gates Failed
Enforce advisory code health rules
(6 files with Excess Number of Function Arguments, Large Method, Complex Method, Code Duplication)
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| ChildrenMemberTypeTreeController.cs | 1 advisory rule | 9.69 | Suppress |
| SiblingMemberTypeTreeController.cs | 1 advisory rule | 10.00 → 9.69 | Suppress |
| MemberTypeImportService.cs | 1 advisory rule | 9.69 | Suppress |
| member-type-folder.server.data-source.ts | 1 advisory rule | 9.69 | Suppress |
| PackageDataInstallation.cs | 1 advisory rule | 3.06 → 2.79 | Suppress |
| UmbracoBuilder.cs | 1 advisory rule | 8.60 → 8.59 | Suppress |
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):
- Code Duplication PackageDataInstallation.cs
- Large Method UmbracoBuilder.cs: AddCoreServices
- Excess Number of Function Arguments ChildrenMemberTypeTreeController.cs: Children
- Excess Number of Function Arguments SiblingMemberTypeTreeController.cs: Siblings
- Complex Method MemberTypeImportService.cs: Import
- Complex Method member-type-folder.server.data-source.ts: UmbMemberTypeFolderServerDataSource.create
✅ Improving Code Health:
- Overall Code Complexity PackageDataInstallation.cs
- Bumpy Road Ahead PackageDataInstallation.cs: CreateContentType
Annotations
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
Children has 5 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
Siblings has 5 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 433 in src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
AddCoreServices increases from 211 to 212 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.
Check warning on line 87 in src/Umbraco.Core/Services/ImportExport/MemberTypeImportService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Complex Method
Import 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.
Check warning on line 81 in src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 7 functions with similar structure: CreateContentFromXml,CreateContentTypeChildFolder,CreateDataTypeChildFolder,PackageDataInstallation and 3 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 864 in src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Bumpy Road Ahead
CreateContentType is no longer above the threshold for logical blocks with deeply nested code. 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 1 in src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.72 to 5.42, 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Complex Method
UmbMemberTypeFolderServerDataSource.create has a cyclomatic complexity of 9, 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.