Introduce INavigationService
for in-memory navigation data
#16818
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +1.24 (5.09 -> 6.33)
- Declining Code Health: 8 findings(s) 🚩
- Improving Code Health: 2 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Large Method UmbracoBuilder.cs: AddCoreServices 🔥
- Code Duplication ContentNavigationServiceBaseTests.cs
- Complex Method ContentService.cs: Copy 🔥
- Primitive Obsession ContentNavigationServiceBase.cs
- Primitive Obsession ContentNavigationServiceBaseTests.cs
- Bumpy Road Ahead MediaService.cs: PerformMoveLocked
- Bumpy Road Ahead ContentService.cs: PerformMoveLocked 🔥
- Bumpy Road Ahead ContentService.cs: Copy 🔥
✅ Improving Code Health:
- Primitive Obsession ContentService.cs 🔥
- Primitive Obsession MediaService.cs
Annotations
Check warning on line 360 in src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ Getting worse: Large Method
AddCoreServices increases from 188 to 193 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 notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 2194 to 2302, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
Check notice on line 69 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Constructor Over-Injection
ContentService increases from 13 to 14 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
Check notice on line 134 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Constructor Over-Injection
ContentService increases from 12 to 13 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
Check notice on line 134 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ New issue: Constructor Over-Injection
ContentService has 12 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
Check notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Number of Functions in a Single Module
The number of functions increases from 107 to 109, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 4.19 to 4.19, 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 warning on line 2659 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ New issue: Bumpy Road Ahead
PerformMoveLocked 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.
Check warning on line 2878 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ New issue: Bumpy Road Ahead
Copy 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.
Check warning on line 2878 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ Getting worse: Complex Method
Copy increases in cyclomatic complexity from 13 to 15, 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 notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 52.54% to 50.16%, 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 warning on line 1 in src/Umbraco.Core/Services/Navigation/ContentNavigationServiceBase.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ New issue: Primitive Obsession
In this module, 53.6% 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ New issue: Code Duplication
The module contains 5 functions with similar structure: Can_Get_Ancestors_From_Existing_Content_Key_In_Correct_Order,Can_Get_Siblings_Of_Existing_Content_Key_In_Correct_Order,Moved_Node_Is_Added_To_Its_New_Parent,Moved_Node_Is_Removed_From_Its_Current_Parent and 1 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ New issue: Primitive Obsession
In this module, 93.9% 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 warning on line 1206 in src/Umbraco.Core/Services/MediaService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
❌ New issue: Bumpy Road Ahead
PerformMoveLocked 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.
Check notice on line 1 in src/Umbraco.Core/Services/MediaService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 60.26% to 56.21%, 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 60 in src/Umbraco.Core/Services/MediaService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Constructor Over-Injection
MediaService increases from 10 to 11 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
Check notice on line 86 in src/Umbraco.Core/Services/MediaService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ Getting worse: Constructor Over-Injection
MediaService increases from 9 to 10 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.
Check notice on line 111 in src/Umbraco.Core/Services/MediaService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)
ℹ New issue: Constructor Over-Injection
MediaService has 9 arguments, threshold = 5. This constructor has too many arguments, indicating an object with low cohesion or missing function argument abstraction. Avoid adding more arguments.