Performance: Optimize refresh of hybrid cache for a document by retrieving draft and published in single query - #21407
Merged
nikolajlauridsen merged 3 commits intoJan 15, 2026
CodeScene Delta Analysis / CodeScene Code Health Review (main)
failed
Jan 15, 2026 in 40s
CodeScene PR Check
Quality Gate Failed
Gates Failed
Enforce advisory code health rules
(2 files with Primitive Obsession, 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 | |
|---|---|---|---|
| DatabaseCacheRepository.cs | 1 advisory rule | 7.04 → 6.83 | Suppress |
| DocumentHybridCacheMockTests.cs | 1 advisory rule | 9.01 → 9.00 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
Details
🚩 Declining Code Health (highest to lowest):
- Large Method DocumentHybridCacheMockTests.cs: SetUp
- Primitive Obsession DatabaseCacheRepository.cs
✅ Improving Code Health:
- Code Duplication DatabaseCacheRepository.cs: GetContentSourceAsync
Annotations
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Code Duplication
reduced similar code in: GetContentSourceAsync. 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, 30.4% 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)
❌ Getting worse: Large Method
SetUp increases from 72 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.
Loading