psyqo: derive GPU display ranges instead of hardcoding them#2052
psyqo: derive GPU display ranges instead of hardcoding them#2052nicolasnoble wants to merge 3 commits into
CodeScene PR Check
Quality Gate Failed
Gates Failed
Enforce advisory code health rules
(1 file with Code Duplication, Complex Method)
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| gpu.cpp | 2 advisory rules | 7.50 → 6.73 | 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 gpu.cpp
- Complex Method gpu.cpp: psyqo::GPU::reinitialize
✅ Improving Code Health:
- Complex Method gpu.cpp: psyqo::GPU::flip
- Complex Method gpu.cpp: psyqo::GPU::initialize
- Bumpy Road Ahead gpu.cpp: psyqo::GPU::initialize
- Bumpy Road Ahead gpu.cpp: psyqo::GPU::flip
Annotations
Check warning on line 329 in src/mips/psyqo/src/gpu.cpp
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 7 functions with similar structure: psyqo::GPU::getClear,psyqo::GPU::getNextClear,psyqo::GPU::getNextScissor,psyqo::GPU::getScissor
and 3 more functions
Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 266 in src/mips/psyqo/src/gpu.cpp
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Complex Method
psyqo::GPU::flip decreases in cyclomatic complexity from 14 to 13, 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 137 in src/mips/psyqo/src/gpu.cpp
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Complex Method
psyqo::GPU::initialize decreases in cyclomatic complexity from 19 to 11, 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 131 in src/mips/psyqo/src/gpu.cpp
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Complex Method
psyqo::GPU::reinitialize 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 notice on line 137 in src/mips/psyqo/src/gpu.cpp
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ Getting better: Bumpy Road Ahead
psyqo::GPU::initialize decreases from 3 to 2 logical blocks with deeply nested code, 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 266 in src/mips/psyqo/src/gpu.cpp
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Bumpy Road Ahead
psyqo::GPU::flip is no longer above the threshold for logical blocks with deeply nested code
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.