Add AsyncMigrationBase
, update base classes and call async methods
#17057
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.02 (9.30 -> 9.28)
- Declining Code Health: 4 findings(s) 🚩
- Improving Code Health: 4 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Code Duplication AsyncMigrationBase.Database.cs
- Primitive Obsession AsyncMigrationBase.Database.cs
- String Heavy Function Arguments AsyncMigrationBase.Database.cs
- Constructor Over-Injection AsyncPackageMigrationBase.cs: AsyncPackageMigrationBase
✅ Improving Code Health:
- Deep, Nested Complexity MigrationPlanExecutor.cs: HandlePostMigrations
- Code Duplication AdvancedMigrationTests.cs
- Complex Method MigrationPlanExecutor.cs: RunMigrationPlan
- Bumpy Road Ahead MigrationPlanExecutor.cs: RunMigrationPlan
Annotations
Check warning on line 61 in src/Umbraco.Infrastructure/Migrations/AsyncMigrationBase.Database.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: AddColumn,AddColumn. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check warning on line 1 in src/Umbraco.Infrastructure/Migrations/AsyncMigrationBase.Database.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Primitive Obsession
In this module, 80.0% 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 1 in src/Umbraco.Infrastructure/Migrations/AsyncMigrationBase.Database.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: String Heavy Function Arguments
In this module, 80.0% of all arguments to its 17 functions are strings. The threshold for string arguments is 39.0%. The functions in this file have a high ratio of strings as arguments. Avoid adding more.
Check notice on line 227 in src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ No longer an issue: Complex Method
RunMigrationPlan is no longer above the threshold for cyclomatic complexity. 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 227 in src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ New issue: Complex Method
RunMigrationPlanAsync 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 notice on line 227 in src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ No longer an issue: Bumpy Road Ahead
RunMigrationPlan is no longer above the threshold for logical blocks with deeply nested code. 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 227 in src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ New issue: Bumpy Road Ahead
RunMigrationPlanAsync 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 173 in src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ No longer an issue: Deep, Nested Complexity
HandlePostMigrations is no longer above the threshold for nested complexity depth. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Check notice on line 173 in src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ New issue: Deep, Nested Complexity
HandlePostMigrationsAsync has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Check warning on line 39 in src/Umbraco.Infrastructure/Packaging/AsyncPackageMigrationBase.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Constructor Over-Injection
AsyncPackageMigrationBase 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Code Duplication
introduced similar code in: CreateKeysAndIndexesAsync,CreateKeysAndIndexesOfTDtoAsync,DeleteKeysAndIndexesOfTDtoAsync. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
✅ Getting better: Code Duplication
reduced similar code in: CreateKeysAndIndexes,CreateKeysAndIndexesOfTDto,DeleteKeysAndIndexesOfTDto. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.