{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/grumpycoders/pcsx-redux/pull/1908","old-code-health":1.9592073850418201,"modified-files":{"code-health":1.9592073850418203,"old-code-health":1.9592073850418201,"files":[{"file":"src/gui/gui.cc","loc":2624,"old-loc":2573,"code-health":1.9592073850418203,"old-code-health":1.9592073850418203}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"1908","analysis-time":"2025-03-18T15:33:50Z","negative-impact-count":0,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":1,"commits":["a813d34e75d2923bd08cb243c2ce03438d048fae"],"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":1.9592073850418203,"version":"3.0","authors":["Michał Ziąbkowski"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":2,"number-of-files-touched":1,"findings":[{"name":"Overall Code Complexity","file":"src/gui/gui.cc","change-type":"improved","change-level":"improvement","is-hotspot?":true,"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 11.08 to 10.41, threshold = 4"},{"name":"Primitive Obsession","file":"src/gui/gui.cc","change-type":"improved","change-level":"improvement","is-hotspot?":true,"why-it-occurs":"Code that uses a high degree of built-in, primitives such as integers, strings, floats, lacks a domain language that encapsulates the validation and semantics of function arguments. Primitive Obsession has several consequences: 1) In a statically typed language, the compiler will detect less erroneous assignments. 2) Security impact since the possible value range of a variable/argument isn't retricted.\n\nIn this module, 38 % of all functions have primitive types as arguments.","how-to-fix":"Primitive Obsession indicates a missing domain language. Introduce data types that encapsulate the details and constraints of your domain. For example, instead of `int userId`, consider `User clicked`.","what-changed":"The ratio of primitive types in function arguments decreases from 37.93% to 37.70%, threshold = 30.0%"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2025-03-18T15:33:50.000Z","project-name":"pcsx-redux","repository":"https://github.com/grumpycoders/pcsx-redux.git"}}