Cache Refreshers: Fix change tracking for content types - #21856
CodeScene PR Check
Quality Gate Failed
Gates Failed
Enforce advisory code health rules
(3 files with Complex Method, Lines of Code in a Single File, Code Duplication, Duplicated Assertion Blocks, Large Method)
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| ContentTypeEditingServiceTests.Create.cs | 3 advisory rules | 5.61 → 4.86 | Suppress |
| ContentTypeEditingServiceTests.Update.cs | 3 advisory rules | 5.05 → 4.90 | Suppress |
| ContentTypeEditingServiceBase.cs | 1 advisory rule | 9.21 → 9.18 | Suppress |
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 ContentTypeEditingServiceTests.Create.cs
- Lines of Code in a Single File ContentTypeEditingServiceTests.Create.cs
- Duplicated Assertion Blocks ContentTypeEditingServiceTests.Create.cs
- Lines of Code in a Single File ContentTypeEditingServiceTests.Update.cs
- Duplicated Assertion Blocks ContentTypeEditingServiceTests.Update.cs
- Large Method ContentTypeEditingServiceTests.Update.cs: Can_Move_Properties_To_Another_Container
- Complex Method ContentTypeEditingServiceBase.cs: UpdatePropertiesAsync
✅ Improving Code Health:
- Low Cohesion ContentTypeEditingServiceTests.Update.cs
- Primitive Obsession ContentTypeEditingServiceTests.Update.cs
Annotations
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Complex Method
UpdatePropertiesAsync 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Lines of Code in a Single File
This module has 1094 lines of code, 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Code Duplication
introduced similar code in: Can_Create_With_All_Basic_Settings,Cannot_Be_Both_Parent_And_Composition,Cannot_Create_Container_With_Unknown_Type,Cannot_Mix_Inheritance_And_ParentKey and 7 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)
❌ New issue: Duplicated Assertion Blocks
The test suite contains 4 functions with duplicated assertion blocks (Cannot_Add_Property_Container_To_Missing_Container,Cannot_Add_Property_To_Missing_Container,Cannot_Create_Property_Container_In_Composition_Container,Cannot_Create_Property_In_Composition_Container), threshold = 2. This test file has several blocks of duplicated assertion statements. Avoid adding more.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Lines of Code in a Single File
This module has 1099 lines of code, 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Low Cohesion
The number of different responsibilities decreases from 32 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.
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
Can_Move_Properties_To_Another_Container increases from 91 to 95 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)
✅ Getting better: Primitive Obsession
The ratio of primitive types in function arguments decreases from 92.86% to 85.71%, 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)
❌ Getting worse: Duplicated Assertion Blocks
The number of functions with duplicated assertion blocks increases from 3 to 5 (introduced in Cannot_Add_Inheritance,Cannot_Add_Inheritance_When_Created_In_A_Folder,Cannot_Add_Multiple_Inheritance,Cannot_Add_Self_As_Inheritance and 1 more functions), threshold = 2. This test file has several blocks of duplicated assertion statements. Avoid adding more.