Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Members and member types in the Management API #15662

Merged
merged 17 commits into from
Feb 5, 2024

Fixed issue with mapping

3f84f29
Select commit
Loading
Failed to load commit list.
Merged

Members and member types in the Management API #15662

Fixed issue with mapping
3f84f29
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v14/dev) failed Feb 2, 2024 in 42s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 17 findings(s) 🚩
  • Improving Code Health: 5 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Large Method UmbracoBuilder.cs: AddCoreServices
  • Large Method UmbracoBuilder.CoreServices.cs: AddCoreInitialServices 🔥
  • Overall Code Complexity MemberEditingService.cs
  • Code Duplication MemberEditingServiceTests.cs
  • Large Assertion Blocks MemberEditingServiceTests.cs
  • Duplicated Assertion Blocks MemberEditingServiceTests.cs
  • Complex Method MemberEditingService.cs: IdentityMemberCreationFailed
  • Complex Method MemberEditingService.cs: UpdateAsync
  • Constructor Over-Injection ContentEditingServiceWithSortingBase.cs: ContentEditingServiceWithSortingBase
  • Primitive Obsession MemberContentEditingService.cs
  • Excess Number of Function Arguments MemberContentEditingService.cs: Copy
  • Constructor Over-Injection MemberContentEditingService.cs: MemberContentEditingService
  • Constructor Over-Injection MemberEditingService.cs: MemberEditingService
  • Complex Method MemberEditingService.cs: ValidateMemberDataAsync
  • Complex Method MemberUserStore.cs: CreateAsync
  • Bumpy Road Ahead MemberEditingService.cs: UpdateAsync
  • Bumpy Road Ahead MemberEditingService.cs: UpdateRoles

✅ Improving Code Health:

  • Primitive Obsession ContentEditingServiceBase.cs
  • Constructor Over-Injection ContentEditingServiceBase.cs: ContentEditingServiceBase
  • Primitive Obsession MemberService.cs
  • String Heavy Function Arguments MemberService.cs
  • Overall Code Complexity ContentEditingServiceBase.cs

Annotations

Check warning on line 336 in src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ Getting worse: Large Method

AddCoreServices increases from 169 to 172 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/ContentEditingServiceBase.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ Getting better: Primitive Obsession

The ratio of primitive types in function arguments decreases from 39.34% to 38.60%, 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 37 in src/Umbraco.Core/Services/ContentEditingServiceBase.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ Getting better: Constructor Over-Injection

ContentEditingServiceBase decreases from 9 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 1 in src/Umbraco.Core/Services/ContentEditingServiceBase.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ No longer an issue: Overall Code Complexity

The mean cyclomatic complexity in this module is no longer above the threshold

Check warning on line 42 in src/Umbraco.Core/Services/ContentEditingServiceWithSortingBase.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Constructor Over-Injection

ContentEditingServiceWithSortingBase 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.

Check warning on line 1 in src/Umbraco.Core/Services/MemberContentEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Primitive Obsession

In this module, 46.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 62 in src/Umbraco.Core/Services/MemberContentEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Excess Number of Function Arguments

Copy has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 25 in src/Umbraco.Core/Services/MemberContentEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Constructor Over-Injection

MemberContentEditingService 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 notice on line 1 in src/Umbraco.Core/Services/MemberService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ Getting better: Primitive Obsession

The ratio of primitive types in function arguments decreases from 71.75% to 70.81%, 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/MemberService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

✅ Getting better: String Heavy Function Arguments

The ratio of strings in function arguments decreases from 48.02% to 45.95%, threshold = 39.0%. The functions in this file have a high ratio of strings as arguments. Avoid adding more.

Check warning on line 248 in src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ Getting worse: Large Method

AddCoreInitialServices increases from 109 to 112 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 306 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Complex Method

IdentityMemberCreationFailed has a cyclomatic complexity of 14, 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 171 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Complex Method

UpdateAsync has a cyclomatic complexity of 12, 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 227 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Complex Method

ValidateMemberDataAsync 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.

Check warning on line 171 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Bumpy Road Ahead

UpdateAsync has 3 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 266 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Bumpy Road Ahead

UpdateRoles 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 1 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Overall Code Complexity

This module has a mean cyclomatic complexity of 4.77 across 13 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 38 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Constructor Over-Injection

MemberEditingService has 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 warning on line 218 in tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Code Duplication

The module contains 2 functions with similar structure: Can_Create_With_Property_Validation,Can_Update_With_Property_Validation. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 51 in tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Large Assertion Blocks

The test suite contains 4 assertion blocks with at least 4 assertions, threshold = 4. This test file has several blocks of large, consecutive assert statements. Avoid adding more.

Check warning on line 51 in tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Duplicated Assertion Blocks

The test suite contains 5 functions with duplicated assertion blocks (Can_Change_Member_Password,Can_Change_Member_Roles,Can_Delete_Member,Can_Update_Member and 1 more functions), threshold = 2. This test file has several blocks of duplicated assertion statements. Avoid adding more.

Check notice on line 72 in src/Umbraco.Infrastructure/Security/MemberIdentityUser.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

ℹ Getting worse: Excess Number of Function Arguments

CreateNew increases from 5 to 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 126 in src/Umbraco.Infrastructure/Security/MemberUserStore.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Complex Method

CreateAsync 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 1 in src/Umbraco.Infrastructure/Security/MemberUserStore.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v14/dev)

ℹ Getting worse: Overall Code Complexity

The mean cyclomatic complexity increases from 4.96 to 5.04, 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.