Adjust the document type creation flow so that a template can be created for a content type (closes #20443) #20688
CodeScene PR Check
Quality Gate Failed
Gates Failed
Enforce advisory code health rules
(3 files with Code Duplication, Missing Arguments Abstractions, Excess Number of Function Arguments)
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| ContentTypeService.cs | 3 advisory rules | 9.69 → 8.28 | Suppress |
| IContentTypeService.cs | 1 advisory rule | 10.00 → 9.69 | Suppress |
| content-type-structure-manager.class.ts | 1 advisory rule | 7.84 → 7.60 | 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 content-type-structure-manager.class.ts: UmbContentTypeStructureManager.reload
- Code Duplication ContentTypeService.cs
- Missing Arguments Abstractions ContentTypeService.cs
- Excess Number of Function Arguments ContentTypeService.cs: CreateTemplateAsync
- Excess Number of Function Arguments IContentTypeService.cs: CreateTemplateAsync
✅ Improving Code Health:
- Constructor Over-Injection ContentTypeService.cs: ContentTypeService
Annotations
Check warning on line 107 in src/Umbraco.Core/Services/ContentTypeService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 5 functions with similar structure: ContentTypeService,ContentTypeService,ContentTypeService,ContentTypeService and 1 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check warning on line 1 in src/Umbraco.Core/Services/ContentTypeService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Missing Arguments Abstractions
The average number of function arguments in this module is 4.14 across 22 functions. The average arguments threshold is 4.00. The functions in this file have too many arguments, indicating a lack of encapsulation or too many responsibilities in the same functions. Avoid adding more.
Check warning on line 277 in src/Umbraco.Core/Services/ContentTypeService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
CreateTemplateAsync has 5 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 80 in src/Umbraco.Core/Services/ContentTypeService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Constructor Over-Injection
ContentTypeService decreases from 12 to 11 arguments, max arguments = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
Check warning on line 51 in src/Umbraco.Core/Services/IContentTypeService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
CreateTemplateAsync 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)
❌ Getting worse: Code Duplication
introduced similar code in: UmbContentTypeStructureManager.reload. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.