V15: Fix Url Preview #18072
V15: Fix Url Preview #18072
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.35 (7.30 -> 7.65)
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 2 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Large Method UmbracoBuilder.cs: AddCoreServices
- Complex Method DocumentUrlService.cs: ListUrlsAsync
- Constructor Over-Injection PublishedUrlInfoProvider.cs: PublishedUrlInfoProvider
✅ Improving Code Health:
- Primitive Obsession DocumentUrlServiceTest_hidetoplevel_false.cs
- String Heavy Function Arguments DocumentUrlServiceTest_hidetoplevel_false.cs
Annotations
Check warning on line 241 in src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ Getting worse: Large Method
AddCoreServices increases from 201 to 202 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 39 in src/Umbraco.Core/Routing/PublishedUrlInfoProvider.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Constructor Over-Injection
PublishedUrlInfoProvider has 8 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 warning on line 528 in src/Umbraco.Core/Services/DocumentUrlService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ Getting worse: Complex Method
ListUrlsAsync already has high cyclomatic complexity, and now it increases in Lines of Code from 112 to 113. 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 (v15/dev)
✅ No longer an issue: Primitive Obsession
The ratio of primivite types in function arguments is no longer above the threshold
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ No longer an issue: String Heavy Function Arguments
The ratio of strings in function arguments is no longer above the threshold