SIO0 overhaul #1673
SIO0 overhaul #1673
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.12 (6.10 -> 5.98)
- Declining Code Health: 12 findings(s) 🚩
- Improving Code Health: 19 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
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 notice on line 689 in src/core/memorycard.cc
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Deep, Nested Complexity
PCSX::MemoryCards::loadMcd has a nested complexity depth of 4, threshold = 4. 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 worse: Lines of Code in a Single File
The lines of code increases from 1050 to 1085, 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/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.