{"results":{"result":{"added-files":{"code-health":8.564024942980211,"old-code-health":0.0,"files":[{"file":"tests/pcsxrunner/msan.cc","loc":216,"code-health":8.564024942980211}]},"external-review-url":"https://github.com/grumpycoders/pcsx-redux/pull/2033","old-code-health":5.327350867226668,"modified-files":{"code-health":5.161077062604933,"old-code-health":5.327350867226668,"files":[{"file":"src/core/DynaRec_aa64/gte_aa64.cc","loc":272,"old-loc":272,"code-health":7.96501745507186,"old-code-health":7.96501745507186},{"file":"src/core/DynaRec_aa64/instructions.cc","loc":1349,"old-loc":1293,"code-health":4.227068509711907,"old-code-health":4.705899055828945},{"file":"src/core/DynaRec_x64/gte_x64.cc","loc":374,"old-loc":374,"code-health":7.952749699631585,"old-code-health":7.952749699631585},{"file":"src/core/DynaRec_x64/instructions.cc","loc":1612,"old-loc":1543,"code-health":3.4829997205598677,"old-code-health":3.5941466682995693},{"file":"src/core/DynaRec_x64/symbols.cc","loc":85,"old-loc":82,"code-health":10.0,"old-code-health":10.0},{"file":"src/core/psxmem.cc","loc":866,"old-loc":849,"code-health":3.6356337136835606,"old-code-health":3.6356337136835606},{"file":"src/core/psxinterpreter.cc","loc":1377,"old-loc":1358,"code-health":6.895153375127571,"old-code-health":7.106711345609554},{"file":"src/core/gpu.cc","loc":1258,"old-loc":1248,"code-health":4.8972613110804595,"old-code-health":4.922073581895509},{"file":"src/main/main.cc","loc":384,"old-loc":373,"code-health":7.796659051646108,"old-code-health":7.796659051646108}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"2033","analysis-time":"2026-06-30T02:12:52Z","negative-impact-count":14,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":3,"commits":["241320803272ba8f7b7365b224663669a22a1afb","97c8e493652496d1adb32980fd0e9f774074750d","01dc987b577cd19e89f49068d5ca43f503238eb0","ac2eecaf0258e08879f3dd187995db75f19f207f","3b754b70da9992b7321a65cf6619f22240c6f64e","acf346bf78f683b6b05b50c487ce97afe2aacd9f","a488eace61a917aad31c6e0309e523e6af55b283","4c220d33cfb3f0cabded448c8ee2a16c0460c52b","52d0b572d4afeab1ce3ccf75c20e1270699e8134","129b4d2a8d918b9168a34b228cd8a96c8ed17720","1613ac3510960341de3f4ab40c04d03d43b5a2db","1c9c384b2dfd1ac8dfd0c849b441ff2b6793069f","53742a9307cf7c46e9266a13f8f1f344f2015cd2","0ecaf37a5fe1a944683dcf19d153929a099778cd","48bdfd09f222edf819be16b62248c99866902da7","0722b5cc2550d08bfcc1e962f7df326dd435f515","9d880e6667bba9c2bdefa0fb6c51ff45b4268f32","0c2b11ff5d42b54c177178fefff58ecf63253893","61e6842f92c5b33cfe8ffa5ff1c3be7299fd5f59","0738a12b7edbb8f4924af67bf982cd15ed1acaf0","5835611362e26f3422441197d4a343e7e2a7c5ba","b3067715e1bb42a6c769aad68806a231dd12fbcd","03d6ce17102ca850b620136e1f8242f218602d74","f1aef19b617d36a31457d1aa46a536ab7d871ec3","9e4c90235b0100a730bf47a41f7e89a47b847c1b","cdc40e36ae0513475e5ecfc870bdb714735c620d","45487a3654d49cc120a2b2d7d350a649486a73c2","3cee0a00fe450fc3441377b20ee59fe180513398","09e817a9dca27b44074e303fe80601e980945cee","8dc8b859cd46e6aa094241edc2294ead14e03b4d","3d9f7c8ce8520426b3ebbcd3510e4ef87747eb46","aacc53520c81dc997a675360d7adc278e53e4fed","1298529c895eedfbbc66e6d7ee42f48596c31de1","2449d4fd0cc2e26607756882c06c9068e415c19a","a61f8dd614b5d93885a1d21d13bd90548da383f2","7ff46741bba5c47f10fa9c5f802f9ea3ccb55a89","7386cab170fc79e1f0dbb4850f8c15f4ed648171","89b9119bfabe4591aeaca283877e03a5714d68ca","0ea228e8a4526c890a3fb8f599a6736ef713cf8f","02720644f7c7ea106d8f9ace5bdc1674f1eaeb84","372957a1058a2529c780495e20f5fa38ba02b2df","b1af11618fa64766c7989aee2d40c274754d39f1","cbca77f0f7488942617e1bd3cad2961a3fdd02b3","ed522a501f7cd8cc70d55dc88717162fc13b8739","25a34b7f67a78b5d3d46b864428351ce637153f5","73e0152ce1e033e97a38845779945ef18227c4b2","1f825a546e70917badf982174a387adbd9bcadf0","ab41d9b3412097e9db8cfa3620cd7f492e0bc07e","43663972a856b87dc51b0eaf5afbb1db5b7eb29e","265fb86c9e62871a8ace4dc01bb9177cea553d4b","deb7f2ddf469bf4e893f7983c4b391f536920dbe","c118bb118016757317d606fa16b758e2d08da1c2","bd230e2fdc73055ee0074604368ac27614561354","e7f75053d0c203c9e0edd9a49ced6e5980e59483","d6c8647097121b137cefc1fff1864c61619be2ef","26be900b22d5b8b4cea9c4a4a1ce634b98e07866","fef195f1ac7c86868244a0f438d21de9e2b7c65e","40b91fa98d6fa2b28b4789e086b663252712bac4","1011074d4189e59fabd7139301e7855d4564f77b","b501af88b3ae9d3128974046bf3ab96bca8b2f14","c72c696eeef6dc3a6d27a516d9450000ed8db371","8358fda7d2ecb0f6acfa104e4453da14e41b4108","6c6011ad1d2c24d53bcbd5de77414fd907c75b68","4dc172696f5d082b6384d59069d7931873371591","e2ef4a4bb2b4bf1eeac4b698fba2a38444fb5f30","ca111019aec8a129f3b1e999a9c6ad142af0b2d5","db7c89c05bcefc14752c6dcbf737a1d279d58e83","16fdb972a7488c5c7bb93949962460b1a82d5dd2","e62bf66fb11d15dd101be75a08be9f1a77a246d0","21957d4cf2bfe23568a672a4f4df54ba799e7078"],"is-negative-review":true,"negative-findings":{"number-of-types":6,"number-of-files-touched":5,"findings":[{"method":"DynaRecCPU::recSWL","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/core/DynaRec_aa64/instructions.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"line":1377,"what-changed":"DynaRecCPU::recSWL has 77 lines, 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":"introduced"},{"method":"DynaRecCPU::recSWR","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/core/DynaRec_aa64/instructions.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"line":1474,"what-changed":"DynaRecCPU::recSWR has 77 lines, 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":"introduced"},{"method":"DynaRecCPU::recLWL","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/core/DynaRec_x64/instructions.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"line":801,"what-changed":"DynaRecCPU::recLWL increases from 74 to 100 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":"degraded"},{"method":"DynaRecCPU::recLWR","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/core/DynaRec_x64/instructions.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"line":919,"what-changed":"DynaRecCPU::recLWR increases from 74 to 97 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":"degraded"},{"method":"DynaRecCPU::recSWL","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/core/DynaRec_x64/instructions.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"line":1183,"what-changed":"DynaRecCPU::recSWL increases from 82 to 92 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":"degraded"},{"method":"DynaRecCPU::recSWR","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/core/DynaRec_x64/instructions.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"line":1305,"what-changed":"DynaRecCPU::recSWR increases from 82 to 92 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":"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/core/psxinterpreter.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":936,"what-changed":"introduced similar code in: InterpretedCPU::psxLWL,InterpretedCPU::psxLWR","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":"degraded"},{"method":"PCSX::GPU::chainedDMAWrite","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/core/gpu.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":590,"what-changed":"PCSX::GPU::chainedDMAWrite increases in cyclomatic complexity from 13 to 14, 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"},{"method":"PCSX::GPU::gpuDmaChainSize","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/core/gpu.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":315,"what-changed":"PCSX::GPU::gpuDmaChainSize increases in cyclomatic complexity from 12 to 13, 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"},{"method":"execInvalidTest","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":"tests/pcsxrunner/msan.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":197,"what-changed":"execInvalidTest has a cyclomatic complexity of 15, 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":"introduced"},{"method":"execValidTest","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":"tests/pcsxrunner/msan.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":44,"what-changed":"execValidTest has a cyclomatic complexity of 12, 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":"introduced"},{"method":"execInvalidTest","why-it-occurs":"A complex conditional is an expression inside a branch such as an <code>if</code>-statmeent which consists of multiple, logical operations. Example: <code>if (x.started() && y.running())</code>.Complex conditionals make the code even harder to read, and contribute to the Complex Method code smell. Encapsulate them.","name":"Complex Conditional","file":"tests/pcsxrunner/msan.cc","refactoring-examples":[{"diff":"diff --git a/complex_conditional.js b/complex_conditional.js\nindex c43da09584..94259ce874 100644\n--- a/complex_conditional.js\n+++ b/complex_conditional.js\n@@ -1,16 +1,34 @@\n function messageReceived(message, timeReceived) {\n-   // Ignore all messages which aren't from known customers:\n-   if (!message.sender &&\n-       customers.getId(message.name) == null) {\n+   // Refactoring #1: encapsulate the business rule in a\n+   // function. A clear name replaces the need for the comment:\n+   if (!knownCustomer(message)) {\n      log('spam received -- ignoring');\n      return;\n    }\n \n-  // Provide an auto-reply when outside business hours:\n-  if ((timeReceived.getHours() > 17) ||\n-      (timeReceived.getHours() < 8)) {\n+  // Refactoring #2: encapsulate the business rule.\n+  // Again, note how a clear function name replaces the\n+  // need for a code comment:\n+  if (outsideBusinessHours(timeReceived)) {\n     return autoReplyTo(message);\n   }\n \n   pingAgentFor(message);\n+}\n+\n+function outsideBusinessHours(timeReceived) {\n+  // Refactoring #3: replace magic numbers with\n+  // symbols that communicate with the code reader:\n+  const closingHour = 17;\n+  const openingHour = 8;\n+\n+  const hours = timeReceived.getHours();\n+\n+  // Refactoring #4: simple conditional rules can\n+  // be further clarified by introducing a variable:\n+  const afterClosing = hours > closingHour;\n+  const beforeOpening = hours < openingHour;\n+\n+  // Yeah -- look how clear the business rule is now!\n+  return afterClosing || beforeOpening;\n }\n\\ No newline at end of file\n","language":"c++","improvement-type":"Complex Conditional"}],"change-level":"warning","is-hotspot?":false,"line":220,"what-changed":"execInvalidTest has 1 complex conditionals with 2 branches, threshold = 2","how-to-fix":"Apply the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring so that the complex conditional is encapsulated in a separate function with a good name that captures the business rule. Optionally, for simple expressions, introduce a new variable which holds the result of the complex conditional.","change-type":"introduced"},{"method":"execInvalidTest","why-it-occurs":"A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health.\n\nA bumpy code road represents a lack of encapsulation which becomes an obstacle to comprehension. In imperative languages there’s also an increased risk for feature entanglement, which leads to complex state management. CodeScene considers the following rules for the code health impact: 1) The deeper the nested conditional logic of each bump, the higher the tax on our working memory. 2) The more bumps inside a function, the more expensive it is to refactor as each bump represents a missing abstraction. 3) The larger each bump – that is, the more lines of code it spans – the harder it is to build up a mental model of the function. The nesting depth for what is considered a bump is  levels of conditionals.","name":"Bumpy Road Ahead","file":"tests/pcsxrunner/msan.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":197,"what-changed":"execInvalidTest has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function","how-to-fix":"Bumpy Road implementations indicate a lack of encapsulation. Check out the detailed description of the [Bumpy Road code health issue](https://codescene.com/blog/bumpy-road-code-complexity-in-context/).\n\nA Bumpy Road often suggests that the function/method does too many things. The first refactoring step is to identify the different possible responsibilities of the function. Consider extracting those responsibilities into smaller, cohesive, and well-named functions. The [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring is the primary response.","change-type":"introduced"},{"why-it-occurs":"Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better.\n\nCyclomatic complexity is a function level metric that measures the number of logical branches (if-else, loops, etc.). Cyclomatic complexity is a rough complexity measure, but useful as a way of estimating the minimum number of unit tests you would need. As such, prefer functions with low cyclomatic complexity (2-3 branches).","name":"Overall Code Complexity","file":"tests/pcsxrunner/msan.cc","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"what-changed":"This module has a mean cyclomatic complexity of 4.10 across 10 functions. The mean complexity threshold is 4","how-to-fix":"You address the overall cyclomatic complexity by a) modularizing the code, and b) abstract away the complexity. Let's look at some examples:\n\nModularizing the Code: Do an X-Ray and inspect the local hotspots. Are there any complex conditional expressions? If yes, then do a [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring. Extract the conditional logic into a separate function and put a good name on that function. This clarifies the intent and makes the original function easier to read. Repeat until all complex conditional expressions have been simplified.\n\n","change-type":"introduced"}]},"positive-impact-count":1,"repo":"pcsx-redux","code-health":5.255397188636123,"version":"3.0","authors":["EngineersBox"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"name":"Overall Code Complexity","file":"src/main/main.cc","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better.\n\nCyclomatic complexity is a function level metric that measures the number of logical branches (if-else, loops, etc.). Cyclomatic complexity is a rough complexity measure, but useful as a way of estimating the minimum number of unit tests you would need. As such, prefer functions with low cyclomatic complexity (2-3 branches).","how-to-fix":"You address the overall cyclomatic complexity by a) modularizing the code, and b) abstract away the complexity. Let's look at some examples:\n\nModularizing the Code: Do an X-Ray and inspect the local hotspots. Are there any complex conditional expressions? If yes, then do a [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring. Extract the conditional logic into a separate function and put a good name on that function. This clarifies the intent and makes the original function easier to read. Repeat until all complex conditional expressions have been simplified.\n\n","what-changed":"The mean cyclomatic complexity decreases from 7.56 to 7.10, threshold = 4"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-06-30T02:12:52.000Z","project-name":"pcsx-redux","repository":"https://github.com/grumpycoders/pcsx-redux.git"}}