{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/grumpycoders/pcsx-redux/pull/1886","old-code-health":8.858373731344182,"modified-files":{"code-health":8.774240586802426,"old-code-health":8.858373731344182,"files":[{"file":"src/core/gte-instructions.cc","loc":389,"old-loc":290,"code-health":8.283981080161325,"old-code-health":8.283981080161325},{"file":"src/core/gte-transfer.cc","loc":101,"old-loc":95,"code-health":8.197184445774983,"old-code-health":8.197184445774983},{"file":"src/core/psxcounters.cc","loc":311,"old-loc":310,"code-health":7.134765815706222,"old-code-health":7.134765815706222},{"file":"src/core/psxemulator.cc","loc":148,"old-loc":148,"code-health":10.0,"old-code-health":10.0},{"file":"src/core/ramlogger.cc","loc":64,"old-loc":66,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/gui/gui.cc","loc":2586,"old-loc":2586,"code-health":1.9592073850418203,"old-code-health":1.9592073850418203},{"file":"src/gui/splash.cc","loc":34148,"old-loc":38416,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"src/gui/widgets/assembly.cc","loc":1086,"old-loc":1087,"code-health":3.4753076825151448,"old-code-health":3.473737249059688},{"file":"src/gui/widgets/heap_viewer.cc","loc":277,"old-loc":275,"code-health":6.532647468890366,"old-code-health":6.536159828453087},{"file":"src/gui/widgets/ram-viewer.cc","loc":444,"old-loc":445,"code-health":5.907969549736891,"old-code-health":5.9048557390241},{"file":"src/gui/widgets/vram-viewer.cc","loc":668,"old-loc":670,"code-health":5.5870439369686,"old-code-health":5.5870439369686},{"file":"src/lua/extra.cc","loc":183,"old-loc":185,"code-health":8.440237581807512,"old-code-health":8.440237581807512},{"file":"src/mips/common/crt0/cxxglue.c","loc":101,"old-loc":103,"code-health":9.842730062691357,"old-code-health":9.842730062691357},{"file":"src/mips/openbios/sio0/card.c","loc":249,"old-loc":252,"code-health":7.308043692637898,"old-code-health":7.308043692637898},{"file":"src/mips/psyqo-paths/archive-manager.hh","loc":210,"old-loc":209,"code-health":10.0,"old-code-health":10.0},{"file":"src/mips/psyqo-paths/cdrom-loader.hh","loc":50,"old-loc":52,"code-health":10.0,"old-code-health":10.0},{"file":"src/mips/psyqo-paths/examples/cdrom-loader/cdrom-loader.cpp","loc":53,"old-loc":54,"code-health":10.0,"old-code-health":10.0},{"file":"src/mips/psyqo/src/alloc.c","loc":419,"old-loc":419,"code-health":6.7790836512463315,"old-code-health":6.7790836512463315},{"file":"src/mips/tests/psyqo/test-bezier.cpp","loc":116,"old-loc":84,"code-health":10.0,"old-code-health":10.0},{"file":"src/mips/tests/psyqo/test-primitives.cpp","loc":56,"old-loc":62,"code-health":10.0,"old-code-health":10.0},{"file":"src/mips/tests/psyqo/test-soft-math.cpp","loc":185,"old-loc":158,"code-health":9.387218218812514,"old-code-health":10.0},{"file":"src/mips/tests/psyqo/test-vector.cpp","loc":153,"old-loc":133,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"src/support/gnu-c++-demangler.cc","loc":569,"old-loc":578,"code-health":3.540202889788133,"old-code-health":3.5353711398858128},{"file":"src/support/version-linux.cc","loc":33,"old-loc":33,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"1886","analysis-time":"2026-04-19T05:55:19Z","negative-impact-count":3,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":1,"commits":["d2d8b6d36e27cfe6bca30ee6de01a2bff4741737"],"is-negative-review":true,"negative-findings":{"number-of-types":2,"number-of-files-touched":2,"findings":[{"method":"PCSX::Widgets::HeapViewer::draw","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the C++ language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"src/gui/widgets/heap_viewer.cc","refactoring-examples":[{"diff":"diff --git a/complex_method.js b/complex_method.js\nindex 10cce78e6d..0c1a8cabaf 100644\n--- a/complex_method.js\n+++ b/complex_method.js\n@@ -1,15 +1,20 @@\n function postItem(item) {\n   if (!item.id) {\n-    if (item.x != null && item.y != null) {\n-      post(item);\n-    } else {\n-      throw Error(\"Item must have x and y\");\n-    }\n+    // extract a separate function for creating new item\n+    postNew(item);\n   } else {\n-    if (item.x < 10 && item.y > 25) {\n-      put(item);\n-    } else {\n-      throw Error(\"Item must have an x and y value between 10 and 25\");\n-    }\n+    // and one for updating existing items\n+    updateItem(item);\n   }\n }\n+\n+function postNew(item) {\n+  validateNew(item);\n+  post(item);\n+}\n+\n+function updateItem(item) {\n+  validateUpdate(item);\n+  put(item);\n+}\n+\n","language":"c++","improvement-type":"Complex Method"}],"change-level":"warning","is-hotspot?":false,"line":192,"what-changed":"PCSX::Widgets::HeapViewer::draw already has high cyclomatic complexity, and now it increases in Lines of Code from 160 to 161","how-to-fix":"There are many reasons for Complex Method. Sometimes, another design approach is beneficial such as a) modeling state using an explicit state machine rather than conditionals, or b) using table lookup rather than long chains of logic. In other scenarios, the function can be split using [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html). Just make sure you extract natural and cohesive functions. Complex Methods can also be addressed by identifying complex conditional expressions and then using the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring.","change-type":"degraded"},{"method":"PCSX::Widgets::HeapViewer::walkHeap","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the C++ language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"src/gui/widgets/heap_viewer.cc","refactoring-examples":[{"diff":"diff --git a/complex_method.js b/complex_method.js\nindex 10cce78e6d..0c1a8cabaf 100644\n--- a/complex_method.js\n+++ b/complex_method.js\n@@ -1,15 +1,20 @@\n function postItem(item) {\n   if (!item.id) {\n-    if (item.x != null && item.y != null) {\n-      post(item);\n-    } else {\n-      throw Error(\"Item must have x and y\");\n-    }\n+    // extract a separate function for creating new item\n+    postNew(item);\n   } else {\n-    if (item.x < 10 && item.y > 25) {\n-      put(item);\n-    } else {\n-      throw Error(\"Item must have an x and y value between 10 and 25\");\n-    }\n+    // and one for updating existing items\n+    updateItem(item);\n   }\n }\n+\n+function postNew(item) {\n+  validateNew(item);\n+  post(item);\n+}\n+\n+function updateItem(item) {\n+  validateUpdate(item);\n+  put(item);\n+}\n+\n","language":"c++","improvement-type":"Complex Method"}],"change-level":"warning","is-hotspot?":false,"line":46,"what-changed":"PCSX::Widgets::HeapViewer::walkHeap already has high cyclomatic complexity, and now it increases in Lines of Code from 104 to 105","how-to-fix":"There are many reasons for Complex Method. Sometimes, another design approach is beneficial such as a) modeling state using an explicit state machine rather than conditionals, or b) using table lookup rather than long chains of logic. In other scenarios, the function can be split using [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html). Just make sure you extract natural and cohesive functions. Complex Methods can also be addressed by identifying complex conditional expressions and then using the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring.","change-type":"degraded"},{"why-it-occurs":"Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.","name":"Code Duplication","file":"src/mips/tests/psyqo/test-soft-math.cpp","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":82,"what-changed":"The module contains 3 functions with similar structure: TEST_CASE,TEST_CASE,TEST_CASE","how-to-fix":"A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. [Read More](https://codescene.com/blog/software-revolution-part3/)\n\nOnce you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.","change-type":"introduced"}]},"positive-impact-count":3,"repo":"pcsx-redux","code-health":8.774240586802426,"version":"3.0","authors":["nicolasnoble"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":3,"number-of-files-touched":3,"findings":[{"name":"Lines of Declarations in a Single File","file":"src/gui/splash.cc","change-type":"improved","change-level":"improvement","is-hotspot?":false,"what-changed":"The lines of data declarations decreases from 38406 to 34138, threshold = 1500"},{"name":"Lines of Code in a Single File","file":"src/gui/widgets/assembly.cc","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"This module has 1056 lines of code (comments stripped away). This puts the module at risk of evolving into a Brain Class. Brain Classes are problematic since changes become more complex over time, harder to test, and challenging to refactor. Act now to prevent future maintenance issues.","how-to-fix":"Look for opportunities to modularize the design. This is done by identifying groups of functions that represent different responsibilities and/or operate on different data. Once you have identified the different responsibilities, then use refactorings like [EXTRACT CLASS](https://refactoring.com/catalog/extractClass.html).","what-changed":"The lines of code decreases from 1057 to 1056, improve code health by reducing it to 1000"},{"method":"PCSX::Widgets::RAMViewer::imguiCB","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the C++ language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"src/gui/widgets/ram-viewer.cc","change-level":"improvement","is-hotspot?":false,"line":301,"what-changed":"PCSX::Widgets::RAMViewer::imguiCB decreases from 87 to 86 lines of code, threshold = 70","how-to-fix":"We recommend to be careful here -- just splitting long functions don't necessarily make the code easier to read. Instead, look for natural chunks inside the functions that expresses a specific task or concern. Often, such concerns are indicated by a Code Comment followed by an if-statement. Use the [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring to encapsulate that concern.","change-type":"improved"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-04-19T05:55:18.000Z","project-name":"pcsx-redux","repository":"https://github.com/grumpycoders/pcsx-redux.git"}}