Skip to content

Spelling.

26e3f60
Select commit
Loading
Failed to load commit list.
Merged

Review: Allow Duplicate Email for Members #16202

Spelling.
26e3f60
Select commit
Loading
Failed to load commit list.
This check has been archived and is scheduled for deletion. Learn more about checks retention
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v13/contrib) failed Feb 5, 2025 in 59s

CodeScene PR Check

Code Health Quality Gates: FAILED

Change in average Code Health of affected files: -0.16 (7.41 -> 7.25)

  • Declining Code Health: 5 findings(s) 🚩
  • Improving Code Health: 6 findings(s) ✅

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Code Duplication MemberController.cs
  • Large Method MemberControllerUnitTests.cs: CreateSut
  • Missing Arguments Abstractions MemberController.cs
  • Complex Method MemberController.cs: ValidateMemberDataAsync
  • Bumpy Road Ahead MemberController.cs: ValidateMemberDataAsync

✅ Improving Code Health:

  • Overall Code Complexity MemberController.cs
  • Missing Arguments Abstractions MemberControllerUnitTests.cs
  • Excess Number of Function Arguments MemberControllerUnitTests.cs: PostSaveMember_SaveNew_NoCustomField_WhenAllIsSetupCorrectly_ExpectSuccessResponse
  • Excess Number of Function Arguments MemberControllerUnitTests.cs: PostSaveMember_SaveNew_CustomField_WhenAllIsSetupCorrectly_ExpectSuccessResponse
  • Excess Number of Function Arguments MemberControllerUnitTests.cs: PostSaveMember_SaveNew_WhenMemberEmailAlreadyExists_ExpectFailResponse
  • Excess Number of Function Arguments MemberControllerUnitTests.cs: PostSaveMember_WhenModelStateIsNotValid_ExpectFailureResponse

Annotations

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 (v13/contrib)

ℹ Getting worse: Primitive Obsession

The ratio of primitive types in function arguments increases from 79.55% to 79.66%, 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 (v13/contrib)

ℹ Getting worse: String Heavy Function Arguments

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

Check warning on line 156 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

❌ New issue: Code Duplication

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

Check warning on line 756 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

❌ Getting worse: Complex Method

ValidateMemberDataAsync increases in cyclomatic complexity from 9 to 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 756 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

❌ New issue: Bumpy Road Ahead

ValidateMemberDataAsync 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 1 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 7.07 to 6.75, 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 warning on line 1 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

❌ New issue: Missing Arguments Abstractions

The average number of function arguments in this module is 4.25 across 16 functions. The average arguments threshold is 4.00. The functions in this file have too many arguments, indicating a lack of encapsulation or too many responsibilities in the same functions. Avoid adding more.

Check notice on line 116 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ Getting worse: Constructor Over-Injection

MemberController increases from 16 to 17 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 156 in src/Umbraco.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ Getting worse: Constructor Over-Injection

MemberController increases from 15 to 16 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.Web.BackOffice/Controllers/MemberController.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ New issue: Constructor Over-Injection

MemberController has 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 45 in src/Umbraco.Web.BackOffice/Filters/MemberSaveModelValidator.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ Getting worse: Constructor Over-Injection

MemberSaveModelValidator 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 47 in src/Umbraco.Web.BackOffice/Filters/MemberSaveValidationAttribute.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ Getting worse: Constructor Over-Injection

MemberSaveValidationFilter 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 563 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ Getting worse: Code Duplication

introduced similar code in: PostSaveMember_SaveNew_WhenMemberEmailAlreadyExists_AndDuplicateEmailsAreAllowed_ExpectSuccessResponse,PostSaveMember_SaveNew_WhenMemberEmailAlreadyExists_ExpectFailResponse. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 708 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

❌ Getting worse: Large Method

CreateSut increases from 105 to 107 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 tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

✅ Getting better: Missing Arguments Abstractions

The average number of function arguments decreases from 7.46 to 7.43, threshold = 4.00. The functions in this file have too many arguments, indicating a lack of encapsulation or too many responsibilities in the same functions. Avoid adding more.

Check notice on line 90 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

✅ Getting better: Excess Number of Function Arguments

PostSaveMember_WhenModelStateIsNotValid_ExpectFailureResponse decreases from 10 to 9 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check notice on line 155 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

✅ Getting better: Excess Number of Function Arguments

PostSaveMember_SaveNew_NoCustomField_WhenAllIsSetupCorrectly_ExpectSuccessResponse decreases from 11 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check notice on line 211 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

✅ Getting better: Excess Number of Function Arguments

PostSaveMember_SaveNew_CustomField_WhenAllIsSetupCorrectly_ExpectSuccessResponse decreases from 11 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check notice on line 430 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

✅ Getting better: Excess Number of Function Arguments

PostSaveMember_SaveNew_WhenMemberEmailAlreadyExists_ExpectFailResponse decreases from 11 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check notice on line 708 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ Getting worse: Excess Number of Function Arguments

CreateSut increases from 9 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check notice on line 500 in tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (v13/contrib)

ℹ New issue: Excess Number of Function Arguments

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