{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/grumpycoders/pcsx-redux/pull/1927","old-code-health":5.066836985193676,"modified-files":{"code-health":4.914889410758039,"old-code-health":5.066836985193676,"files":[{"file":"src/gui/widgets/memory_observer.cc","loc":537,"old-loc":494,"code-health":4.914889410758039,"old-code-health":5.066836985193676}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"1927","analysis-time":"2025-07-31T14:17:29Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["943c84710484fa88f84db3ab4d895fa76f020adc","51abf1a3524deef51a388ddca4304ee32c8050d1"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"PCSX::Widgets::MemoryObserver::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/memory_observer.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":82,"what-changed":"PCSX::Widgets::MemoryObserver::draw increases in cyclomatic complexity from 99 to 111, threshold = 9","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"}]},"positive-impact-count":0,"repo":"pcsx-redux","code-health":4.914889410758039,"version":"3.0","authors":["notdodgeball"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2025-07-31T14:17:29.000Z","project-name":"pcsx-redux","repository":"https://github.com/grumpycoders/pcsx-redux.git"}}