{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/dimagi/open-chat-studio/pull/3795","old-code-health":9.624865678345838,"modified-files":{"code-health":9.5507732201989,"old-code-health":9.624865678345838,"files":[{"file":"apps/teams/export/client.py","loc":80,"old-loc":58,"code-health":10.0,"old-code-health":10.0},{"file":"apps/teams/export/importer.py","loc":372,"old-loc":318,"code-health":10.0,"old-code-health":9.387218218812514},{"file":"apps/teams/export/tests/test_client.py","loc":101,"old-loc":82,"code-health":10.0,"old-code-health":10.0},{"file":"apps/teams/export/tests/test_command.py","loc":344,"old-loc":342,"code-health":10.0,"old-code-health":10.0},{"file":"apps/teams/export/tests/test_importer.py","loc":800,"old-loc":675,"code-health":8.816158827775617,"old-code-health":9.387218218812514},{"file":"apps/teams/management/commands/sync_team.py","loc":325,"old-loc":297,"code-health":8.769450206273154,"old-code-health":8.769450206273154},{"file":"apps/teams/export/manifest.py","loc":218,"old-loc":213,"code-health":10.0,"old-code-health":10.0},{"file":"apps/teams/export/tests/test_manifest.py","loc":209,"old-loc":167,"code-health":10.0,"old-code-health":10.0},{"file":"apps/teams/tasks.py","loc":126,"old-loc":125,"code-health":10.0,"old-code-health":10.0},{"file":"apps/teams/tests/test_file_export.py","loc":148,"old-loc":148,"code-health":10.0,"old-code-health":10.0},{"file":"apps/documents/tasks.py","loc":331,"old-loc":331,"code-health":9.387218218812514,"old-code-health":9.387218218812514},{"file":"apps/documents/tests/test_tasks.py","loc":396,"old-loc":381,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"3795","analysis-time":"2026-07-09T13:33:45Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["11b2d58c67521bd3b2ec9a5a44c0329edeb1b029","98ff8898885c2ddb32bb13cc34e44d0f7525b3d6","42eaed5372e82e2e3689aaea1bc3aad4e27454e2","f365f4ff58b6b779b53d877fab9a33867c12ab81","ddd8d8bafc8e52d4feb28440d9242e522430557a"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"why-it-occurs":"This module has 611 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.","name":"Lines of Code in a Single File","file":"apps/teams/export/tests/test_importer.py","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"what-changed":"This module has 611 lines of code, improve code health by reducing it to 600","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).","change-type":"introduced"}]},"positive-impact-count":1,"repo":"open-chat-studio","code-health":9.5507732201989,"version":"3.0","authors":["Chris Smit"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"name":"Overall Code Complexity","file":"apps/teams/export/importer.py","change-type":"fixed","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 in this module is no longer above the threshold"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-07-09T13:33:44.000Z","project-name":"open-chat-studio","repository":"https://github.com/dimagi/open-chat-studio.git"}}