Members: Add lightweight external-only members (closes #12741) - #22162
CodeScene PR Check
Quality Gate Failed
Code Health Improved
(3 files improve in Code Health)
Gates Failed
Enforce critical code health rules
(2 files with Bumpy Road Ahead)
Enforce advisory code health rules
(26 files with Large Method, Code Duplication, Primitive Obsession, Complex Method, Excess Number of Function Arguments, String Heavy Function Arguments, Constructor Over-Injection, Complex Conditional)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| ExternalMemberIndexingNotificationHandler.cs | 1 critical rule | 9.84 | Suppress |
| MemberUserStore.cs | 1 critical rule | 4.71 → 4.77 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| ExternalMemberService.cs | 3 advisory rules | 8.55 | Suppress |
| AuditNotificationsHandlerMemberTests.cs | 1 advisory rule | 8.82 | Suppress |
| PublishedExternalMember.cs | 4 advisory rules | 8.82 | Suppress |
| ExternalMemberRepository.cs | 2 advisory rules | 9.10 | Suppress |
| RevokeMemberAuthenticationTokensNotificationHandler.cs | 1 advisory rule | 10.00 → 9.10 | Suppress |
| member-profile-data-workspace-info-app.element.ts | 2 advisory rules | 9.10 | Suppress |
| ProfileModelBuilderTests.cs | 1 advisory rule | 9.39 | Suppress |
| MemberPresentationFactoryTests.cs | 1 advisory rule | 9.39 | Suppress |
| MemberFilterServiceTests.cs | 1 advisory rule | 9.39 | Suppress |
| MemberIdentityUserTests.cs | 1 advisory rule | 9.39 | Suppress |
| ExternalMemberIndexingNotificationHandlerTests.cs | 1 advisory rule | 9.39 | Suppress |
| MemberIndexingNotificationHandlerTests.cs | 1 advisory rule | 9.39 | Suppress |
| ExternalMemberServiceTests.cs | 1 advisory rule | 9.39 | Suppress |
| AuditNotificationsHandler.cs | 1 advisory rule | 7.91 → 7.44 | Suppress |
| MemberFilterRepository.cs | 1 advisory rule | 9.69 | Suppress |
| MemberFilterService.cs | 1 advisory rule | 9.69 | Suppress |
| MemberPickerValueConverter.cs | 1 advisory rule | 9.54 → 9.24 | Suppress |
| ExamineUmbracoIndexingHandler.cs | 1 advisory rule | 7.55 → 7.33 | Suppress |
| MemberEditingService.cs | 1 advisory rule | 7.49 → 7.41 | Suppress |
| member-workspace-view-member.element.ts | 1 advisory rule | 9.12 → 9.06 | Suppress |
| UmbracoBuilder.CoreServices.cs | 1 advisory rule | 8.77 → 8.74 | Suppress |
| MemberSignInManager.cs | 1 advisory rule | 8.86 → 8.84 | Suppress |
| MemberIndexingNotificationHandler.cs | 1 advisory rule | 8.81 → 8.78 | Suppress |
| UmbracoBuilder.Repositories.cs | 1 advisory rule | 9.59 → 9.58 | Suppress |
| UmbracoPlan.cs | 1 advisory rule | 9.55 → 9.54 | Suppress |
| UmbracoBuilder.cs | 1 advisory rule | 8.57 → 8.57 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| MemberUserStore.cs | 4.71 → 4.77 | Overall Code Complexity, Primitive Obsession |
| MemberUserStoreTests.cs | 8.17 → 8.70 | Overall Code Complexity |
| MemberEditingServiceTests.cs | 7.55 → 8.03 | Code Duplication |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Details
🚩 Declining Code Health (highest to lowest):
- Code Duplication ExamineUmbracoIndexingHandler.cs
- Code Duplication AuditNotificationsHandler.cs
- Code Duplication AuditNotificationsHandlerMemberTests.cs
- Large Method UmbracoBuilder.cs: AddCoreServices
- Code Duplication RevokeMemberAuthenticationTokensNotificationHandler.cs
- Code Duplication ExternalMemberService.cs
- Large Method UmbracoBuilder.CoreServices.cs: AddCoreNotifications
- Code Duplication ExternalMemberRepository.cs
- Code Duplication ExternalMemberServiceTests.cs
- Code Duplication MemberFilterServiceTests.cs
- Code Duplication MemberPresentationFactoryTests.cs
- Code Duplication ExternalMemberIndexingNotificationHandlerTests.cs
- Code Duplication MemberIndexingNotificationHandlerTests.cs
- Code Duplication MemberIdentityUserTests.cs
- Code Duplication ProfileModelBuilderTests.cs
- Large Method member-workspace-view-member.element.ts: UmbMemberWorkspaceViewMemberElement.renderLeftColumn
- Complex Method MemberIndexingNotificationHandler.cs: Handle
- Complex Method MemberEditingService.cs: ValidateMemberDataAsync
- Large Method UmbracoPlan.cs: UmbracoPlan
- Large Method UmbracoBuilder.Repositories.cs: AddRepositories
- Complex Method MemberSignInManager.cs: AutoLinkAndSignInExternalAccount
- Complex Method MemberPickerValueConverter.cs: ConvertIntermediateToObject
- Complex Method PublishedExternalMember.cs: ConvertJsonElement
- Primitive Obsession PublishedExternalMember.cs
- Excess Number of Function Arguments PublishedExternalMember.cs: ConvertInterToDeliveryApiObject
- String Heavy Function Arguments PublishedExternalMember.cs
- Primitive Obsession ExternalMemberService.cs
- Constructor Over-Injection ExternalMemberService.cs: ExternalMemberService
- Primitive Obsession ExternalMemberRepository.cs
- Excess Number of Function Arguments MemberFilterRepository.cs: AppendWhereFilters
- Excess Number of Function Arguments MemberFilterService.cs: FilterAsync
- Complex Method member-profile-data-workspace-info-app.element.ts: UmbMemberProfileDataWorkspaceInfoAppElement.renderValue
- Complex Conditional member-profile-data-workspace-info-app.element.ts: UmbMemberProfileDataWorkspaceInfoAppElement.renderValue
- Complex Conditional member-profile-data-workspace-info-app.element.ts: UmbMemberProfileDataWorkspaceInfoAppElement.renderContent
- Bumpy Road Ahead ExternalMemberIndexingNotificationHandler.cs: Handle
- Bumpy Road Ahead MemberUserStore.cs: UpdateExternalMemberAsync
✅ Improving Code Health:
- Overall Code Complexity MemberRepository.cs
- Overall Code Complexity MemberUserStore.cs
- Overall Code Complexity MemberEditingService.cs
- Primitive Obsession MemberUserStore.cs
- Code Duplication MemberEditingServiceTests.cs
- Overall Code Complexity MemberUserStoreTests.cs
Annotations
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
AddRepositories increases from 73 to 75 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 173 in src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
UmbracoPlan increases from 81 to 82 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: MapToDto,MapToIdentity. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Primitive Obsession
In this module, 61.1% 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Bumpy Road Ahead
Handle has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks 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 1005 in src/Umbraco.Infrastructure/Security/MemberUserStore.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Bumpy Road Ahead
UpdateExternalMemberAsync has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks 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.Infrastructure/Security/MemberUserStore.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.22 to 5.21, 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.Infrastructure/Security/MemberUserStore.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Primitive Obsession
The ratio of primivite types in function arguments is no longer above the threshold
Check warning on line 452 in src/Umbraco.Infrastructure/Services/MemberEditingService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Complex Method
ValidateMemberDataAsync increases in cyclomatic complexity from 13 to 17, 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/Services/MemberEditingService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 5.60 to 5.41, 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Overall Code Complexity
The mean cyclomatic complexity in this module is no longer above the threshold
Check warning on line 288 in src/Umbraco.Web.Common/Security/MemberSignInManager.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Complex Method
AutoLinkAndSignInExternalAccount increases in cyclomatic complexity from 14 to 15, 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 Code Health Review (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: GivenAnExternalOnlyMember_WhenBuildForCurrentMember_ThenCustomPropertiesAreEmpty,GivenAnExternalOnlyMember_WhenBuildForCurrentMember_ThenDoesNotCallMemberService. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 5 functions with similar structure: HandleAsync,HandleAsync,HandleAsync,RevokeTokensAsync and 1 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check warning on line 1 in src/Umbraco.Core/Handlers/AuditNotificationsHandler.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Code Duplication
introduced similar code in: HandleAsync,HandleAsync,HandleAsync,HandleAsync. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
AddCoreNotifications increases from 106 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 12 functions with similar structure: ContentAndExternalMembers_UseSameEventTypeForDelete,ContentAndExternalMembers_UseSameEventTypeForSave,GivenAContentMember_WhenDeleted_ThenAuditEntryWrittenWithMemberDeleteEventType,GivenAContentMember_WhenRolesAssigned_ThenAuditEntryWrittenWithRolesAssignedEventType and 8 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Code Duplication
The module no longer contains too many functions with similar structure
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 3 functions with similar structure: CreateResponseModelAsync_Checks_TwoFactor_Status,CreateResponseModelAsync_Maps_Member_Via_UmbracoMapper,CreateResponseModelAsync_Returns_Default_Kind_For_Regular_Member. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
AppendWhereFilters has 8 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 42 in src/Umbraco.Infrastructure/Services/Implement/MemberFilterService.cs
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
FilterAsync has 5 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: Filter_Returns_Content_Members,Filter_Returns_External_Members. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
UmbMemberWorkspaceViewMemberElement.renderLeftColumn increases from 86 to 98 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: GetProfileData_With_CaseInsensitive_Options_Returns_Typed_Object,GetProfileData_With_Matching_Case_Works_Without_Options. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Complex Method
ConvertIntermediateToObject 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.