SIO0 overhaul #1673
SIO0 overhaul #1673
CodeScene PR Check
Quality Gate Failed
Code Health Improved
(3 files improve in Code Health)
Gates Failed
Prevent hotspot decline
(1 hotspot with Code Duplication)
Enforce critical code health rules
(1 file with Bumpy Road Ahead)
Enforce advisory code health rules
(3 files with Code Duplication, Complex Method, Primitive Obsession)
Gates Passed
1 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Prevent hotspot decline | Violations | Code Health Impact | |
|---|---|---|---|
| sio.cc | 1 rule in this hotspot | 6.56 → 8.75 | Suppress |
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| memorycard.cc | 1 critical rule | 6.45 → 5.37 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| memorycard.cc | 3 advisory rules | 6.45 → 5.37 | Suppress |
| memcard_manager.cc | 1 advisory rule | 6.88 → 6.86 | Suppress |
| sio.cc | 1 advisory rule | 6.56 → 8.75 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| memorycard.cc | 6.45 → 5.37 | Complex Method, Bumpy Road Ahead, Overall Code Complexity, Deep, Nested Complexity |
| pad.cc | no change | Overall Code Complexity |
| sio.cc | 6.56 → 8.75 | Complex Method, Bumpy Road Ahead, Overall Code Complexity, Deep, Nested Complexity |
| sstate.cc | 9.25 → 9.27 | Large Method |
| main.cc | 7.84 → 7.89 | Complex Method, Overall Code Complexity |
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):
- Complex Method memcard_manager.cc: PCSX::Widgets::MemcardManager::draw
- Code Duplication memorycard.cc
- Complex Method memorycard.cc: PCSX::MemoryCards::getMcdBlockInfo
- Code Duplication sio.cc 🔥
- Complex Method memorycard.cc: PCSX::MemoryCards::loadMcd
- Complex Method memorycard.cc: PCSX::MemoryCards::copyMcdFile
- Primitive Obsession memorycard.cc
- Complex Method memorycard.cc: PCSX::MemoryCards::createMcd
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCards::getMcdBlockInfo
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCards::loadMcd
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCards::saveMcd
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCards::createMcd
✅ Improving Code Health:
- Complex Method main.cc: pcsxMain
- Large Method sstate.cc: PCSX::SaveStates::constructSaveState
- Overall Code Complexity memorycard.cc
- Overall Code Complexity pad.cc 🔥
- Overall Code Complexity main.cc
- Complex Method memorycard.cc: PCSX::MemoryCard::loadMcd
- Complex Method memorycard.cc: PCSX::MemoryCard::createMcd
- Deep, Nested Complexity memorycard.cc: PCSX::MemoryCard::loadMcd
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCard::loadMcd
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCard::saveMcd
- Bumpy Road Ahead memorycard.cc: PCSX::MemoryCard::createMcd
- Complex Method sio.cc: PCSX::SIO::getMcdBlockInfo 🔥
- Complex Method sio.cc: PCSX::SIO::writePad 🔥
- Complex Method sio.cc: PCSX::SIO::transmitData 🔥
- Complex Method sio.cc: PCSX::SIO::copyMcdFile 🔥
- Bumpy Road Ahead sio.cc: PCSX::SIO::transmitData 🔥
- Bumpy Road Ahead sio.cc: PCSX::SIO::getMcdBlockInfo 🔥
- Overall Code Complexity sio.cc 🔥
- Deep, Nested Complexity sio.cc: PCSX::SIO::transmitData 🔥
Annotations
Check warning on line 514 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Code Duplication
introduced similar code in: PCSX::MemoryCards::findFirstFree,PCSX::MemoryCards::getFreeSpace. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 689 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
PCSX::MemoryCard::loadMcd is no longer above the threshold for cyclomatic complexity. 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 731 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
PCSX::MemoryCard::createMcd is no longer above the threshold for cyclomatic complexity. 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 174 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PCSX::MemoryCards::getMcdBlockInfo has a cyclomatic complexity of 31, 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 689 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PCSX::MemoryCards::loadMcd has a cyclomatic complexity of 14, 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 302 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PCSX::MemoryCards::copyMcdFile has a cyclomatic complexity of 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 731 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
PCSX::MemoryCards::createMcd 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 689 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
PCSX::MemoryCard::loadMcd 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.
Check notice on line 728 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
PCSX::MemoryCard::saveMcd 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.
Check notice on line 731 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
PCSX::MemoryCard::createMcd 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.
Check warning on line 174 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
PCSX::MemoryCards::getMcdBlockInfo 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 warning on line 689 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
PCSX::MemoryCards::loadMcd 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 warning on line 728 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
PCSX::MemoryCards::saveMcd 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 warning on line 731 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
PCSX::MemoryCards::createMcd 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/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 8.09 to 7.14, 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 notice on line 689 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Deep, Nested Complexity
PCSX::MemoryCard::loadMcd is no longer above the threshold for nested complexity depth. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Check warning on line 1 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Primitive Obsession
In this module, 31.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.
Check notice on line 1 in src/core/pad.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 9.58 to 9.53, 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 126 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Code Duplication
The module contains 2 functions with similar structure: PCSX::SIO::writeCard,PCSX::SIO::writePad. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 285 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
PCSX::SIO::getMcdBlockInfo is no longer above the threshold for cyclomatic complexity. 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 145 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
PCSX::SIO::writePad is no longer above the threshold for cyclomatic complexity. 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 177 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
PCSX::SIO::transmitData is no longer above the threshold for cyclomatic complexity. 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 285 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
PCSX::SIO::copyMcdFile is no longer above the threshold for cyclomatic complexity. 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 177 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
PCSX::SIO::transmitData is no longer above the threshold for logical blocks with deeply nested code
Check notice on line 285 in src/core/sio.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
PCSX::SIO::getMcdBlockInfo is no longer above the threshold for logical blocks with deeply nested code