API access with client credentials (core functionality) #16817
CodeScene PR Check
✅ Code Health Quality Gates: OK
Change in average Code Health of affected files: +0.26 (7.02 -> 7.28)
-
Declining Code Health: 4 findings(s) 🚩
-
Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Large Method UserOrCurrentUserControllerBase.cs: UserOperationStatusResult
- Complex Method MemberController.cs: Token
- Complex Conditional MemberController.cs: Token
- Constructor Over-Injection MemberController.cs: MemberController
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Constructor Over-Injection
BackOfficeController increases from 8 to 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 notice on line 1 in src/Umbraco.Core/Services/UserService.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 1746 to 1784, 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/UserService.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 90 to 94, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check notice on line 1196 in src/Umbraco.Core/Services/UserService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Complex Method
ChangePasswordAsync 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.
Check notice on line 1 in src/Umbraco.Core/Services/UserService.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 55.61% to 56.77%, 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 Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Primitive Obsession
The ratio of primitive types in function arguments increases from 52.56% to 55.95%, 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 Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Low Cohesion
The number of different responsibilities increases from 10 to 12, threshold = 3. Cohesion is calculated using the LCOM4 metric. Low cohesion means that the module/class has multiple unrelated responsibilities, doing too many things and breaking the Single Responsibility Principle.
Check warning on line 135 in src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Complex Method
Token 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 113 in src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Complex Conditional
Token has 1 complex conditionals with 2 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
Check warning on line 58 in src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ New issue: Constructor Over-Injection
MemberController has 6 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 159 in src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
ℹ Getting worse: Excess Number of Function Arguments
CreateNew increases from 6 to 7 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (v15/dev)
❌ Getting worse: Large Method
UserOperationStatusResult increases from 125 to 129 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.