Introduce methods on new service to have alternative to obsoleted methods #17208
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.13 (8.72 -> 8.85)
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 2 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Code Duplication CacheRefreshingNotificationHandler.cs
- Complex Method UmbracoIntegrationTestWithMediaEditing.cs: CreateTestData
- Excess Number of Function Arguments MediaEditingBuilder.cs: CreateMediaWithAProperty
✅ Improving Code Health:
- Code Duplication MediaHybridCacheTests.cs
- Excess Number of Function Arguments ContentTypeEditingBuilder.cs: CreateSimpleContentType
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: HandleAsync,HandleAsync. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 69 in src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Constructor Over-Injection
DocumentCacheService 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 1 in tests/Umbraco.Tests.Common/Builders/ContentEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 95.45% to 100.00%, 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 77 in tests/Umbraco.Tests.Common/Builders/ContentEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ New issue: Excess Number of Function Arguments
CreateContentWithTwoInvariantProperties has 7 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1 in tests/Umbraco.Tests.Common/Builders/ContentEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: String Heavy Function Arguments
The ratio of strings in function arguments increases from 50.00% to 54.17%, threshold = 39.0%. The functions in this file have a high ratio of strings as arguments. Avoid adding more.
Check notice on line 1 in tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 82.61% to 95.83%, 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 65 in tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
✅ No longer an issue: Excess Number of Function Arguments
CreateSimpleContentType is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 220 in tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ New issue: Excess Number of Function Arguments
CreateContentTypeWithTwoPropertiesOneVariantAndOneInvariant has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1 in tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: String Heavy Function Arguments
The ratio of strings in function arguments increases from 47.83% to 79.17%, threshold = 39.0%. The functions in this file have a high ratio of strings as arguments. Avoid adding more.
Check notice on line 1 in tests/Umbraco.Tests.Common/Builders/Extensions/BuilderExtensions.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 39.13% to 42.27%, 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 31 in tests/Umbraco.Tests.Common/Builders/MediaEditingBuilder.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
❌ New issue: Excess Number of Function Arguments
CreateMediaWithAProperty has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
❌ New issue: Complex Method
CreateTestData 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Code Duplication
introduced similar code in: Can_Get_Updated_Media_By_Id,Can_Get_Updated_Media_By_Key. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
✅ Getting better: Code Duplication
reduced similar code in: Can_Get_Media_By_Id,Can_Get_Media_By_Key,Cannot_Get_Deleted_Media_By_Id,Cannot_Get_Deleted_Media_By_Key. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 34 in src/Umbraco.Core/Cache/Refreshers/Implement/ContentTypeCacheRefresher.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Constructor Over-Injection
ContentTypeCacheRefresher increases from 7 to 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 notice on line 30 in src/Umbraco.Core/Cache/Refreshers/Implement/DataTypeCacheRefresher.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Constructor Over-Injection
DataTypeCacheRefresher increases from 6 to 7 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/EntityTypeContainerService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (contrib)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 44.83% to 48.39%, 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.