{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/grumpycoders/pcsx-redux/pull/1948","old-code-health":7.148677383062011,"modified-files":{"code-health":7.148991824161527,"old-code-health":7.148677383062011,"files":[{"file":"tools/vscode-extension/templates.js","loc":878,"old-loc":872,"code-health":7.650635066647554,"old-code-health":7.650635066647554},{"file":"tools/vscode-extension/tools.js","loc":700,"old-loc":696,"code-health":6.51978787144334,"old-code-health":6.51978787144334}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"1948","analysis-time":"2025-10-11T21:48:54Z","negative-impact-count":0,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["f4d353c8eb78ff02f8acfbc7fcd5b9bf26717549","fdfa891774444833600f8a69ef9fe1262ebaaa5a"],"is-negative-review":false,"negative-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"positive-impact-count":2,"repo":"pcsx-redux","code-health":7.148991824161527,"version":"3.0","authors":["spicyjpeg"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":2,"number-of-files-touched":1,"findings":[{"name":"Overall Code Complexity","file":"tools/vscode-extension/tools.js","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.06 to 6.42, threshold = 4"},{"method":"checkPython","why-it-occurs":"Deep nested logic means that you have control structures like if-statements or loops inside other control structures. Deep nested logic increases the cognitive load on the programmer reading the code. The human working memory has a maximum capacity of 3-4 items; beyond that threshold, we struggle with keeping things in our head. Consequently, deep nested logic has a strong correlation to defects and accounts for roughly 20% of all programming mistakes.\n\nCodeScene measures the maximum nesting depth inside each function. The deeper the nesting, the lower the code health. The threshold for the JavaScript language is  levels of nesting.","name":"Deep, Nested Complexity","file":"tools/vscode-extension/tools.js","change-level":"improvement","is-hotspot?":false,"line":460,"what-changed":"checkPython is no longer above the threshold for nested complexity depth","how-to-fix":"Occassionally, it's possible to get rid of the nested logic by [Replacing Conditionals with Guard Clauses](https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html).\n\nAnother viable strategy is to identify smaller building blocks inside the nested chunks of logic and extract those responsibilities into smaller, cohesive, and well-named functions. The [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring explains the steps.","change-type":"fixed"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2025-10-11T21:48:54.000Z","project-name":"pcsx-redux","repository":"https://github.com/grumpycoders/pcsx-redux.git"}}