Improve document schedule #17535
Improve document schedule #17535
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.46 (4.10 -> 4.57)
- Declining Code Health: 8 findings(s) 🚩
- Improving Code Health: 3 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Large Assertion Blocks ContentPublishingServiceTests.cs
- Code Duplication ContentPublishingServiceTests.cs
- Duplicated Assertion Blocks ContentPublishingServiceTests.cs
- Overall Code Complexity DocumentPresentationFactory.cs
- Lines of Code in a Single File ContentPublishingServiceTests.cs
- Complex Method ContentPublishingService.cs: PublishAsync
- Complex Method IDocumentPresentationFactory.cs: CreateCulturePublishScheduleModels
- Complex Method DocumentPresentationFactory.cs: CreateCulturePublishScheduleModels
✅ Improving Code Health:
- Overall Code Complexity ContentService.cs
- Primitive Obsession ContentService.cs
- Bumpy Road Ahead ContentPublishingService.cs: PublishAsync
Annotations
Check notice on line 1 in src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Code Duplication
introduced similar code in: CreateResponseModelAsync. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check warning on line 259 in src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Complex Method
CreateCulturePublishScheduleModels 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 1 in src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.20 across 10 functions. The mean complexity threshold is 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 86 in src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Complex Method
CreateCulturePublishScheduleModels 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 168 in src/Umbraco.Core/Services/ContentPublishingService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ Getting worse: Complex Method
PublishAsync increases in cyclomatic complexity from 14 to 20, 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 168 in src/Umbraco.Core/Services/ContentPublishingService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ Getting better: Bumpy Road Ahead
PublishAsync decreases from 3 to 2 logical blocks with deeply nested code, threshold is one single 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/ContentPublishingService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 6.89 to 7.40, 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 notice on line 1 in src/Umbraco.Core/Services/ContentPublishingService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 42.31% to 44.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 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 2185 to 2228, 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 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Number of Functions in a Single Module
The number of functions increases from 108 to 110, 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 (v15/dev)
ℹ Getting worse: Code Duplication
introduced similar code in: ContentService,ContentService. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 4.14 to 4.09, 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 notice on line 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 49.50% to 47.32%, 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 74 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Constructor Over-Injection
ContentService increases from 14 to 15 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 105 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/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 139 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/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 1 in src/Umbraco.Core/Services/ContentService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Lines of Code in a Single File
This module has 1252 lines of code, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Code Duplication
The module contains 30 functions with similar structure: Can_Clear_Schedule_All_Cultures,Can_Clear_Schedule_Invariant,Can_Clear_Schedule_Single_Culture,Can_Clear_Schedule_Some_Cultures and 26 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Large Assertion Blocks
The test suite contains 14 assertion blocks with at least 4 assertions, threshold = 4. This test file has several blocks of large, consecutive assert statements. Avoid adding more.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Duplicated Assertion Blocks
The test suite contains 6 functions with duplicated assertion blocks (Can_Clear_Schedule_Single_Culture,Can_Clear_Schedule_Some_Cultures,Can_Unschedule_Publish_All_Cultures,Can_Unschedule_Publish_Some_Cultures and 2 more functions), threshold = 2. This test file has several blocks of duplicated assertion statements. Avoid adding more.