{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/pytroll/satpy/pull/3342","old-code-health":7.695798410394483,"modified-files":{"code-health":7.353464552350734,"old-code-health":7.695798410394483,"files":[{"file":"satpy/scene.py","loc":1393,"old-loc":1365,"code-health":6.958679722533031,"old-code-health":6.958679722533031},{"file":"satpy/tests/scene_tests/test_resampling.py","loc":591,"old-loc":505,"code-health":8.283981080161325,"old-code-health":9.6882083290695}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"3342","analysis-time":"2026-03-06T03:37:24Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":1,"commits":["ab5f2f09e36b04937d10f6975249ecd214121ec8"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"why-it-occurs":"Cohesion is a measure of how well the elements in a file belong together. CodeScene measures cohesion using the LCOM4 metric (Lack of Cohesion Measure). With LCOM4, the functions inside a module are related if a) they access the same data members, or b) they call each other. High Cohesion is desirable as it means that all functions are related and likely to represent the same responsibility. Low Cohesion is problematic since it means that the module contains multiple behaviors. Low Cohesion leads to code that's harder to understand, requires more tests, and very often become a coordination magnet for developers.","name":"Low Cohesion","file":"satpy/tests/scene_tests/test_resampling.py","refactoring-examples":[{"diff":"diff --git a/low_cohesion_example.js b/low_cohesion_example.js\nindex 1ae56cf85b..209fc02c73 100644\n--- a/low_cohesion_example.js\n+++ b/low_cohesion_example.js\n@@ -2,8 +2,10 @@\n \n var userLayer = connectUsers(myConnectionProperties);\n \n-var chessEngine = startEngine(gameProperties);\n+// [Refactoring: moved the data related to chess to a new chessGame.js module]\n \n+// The module contains login related functionality that forms one behaviour: all\n+// code is related since it either a) uses the same data, or b) calls the same functions.\n export function login(newUser) {\n   val authenticated = userLayer.authenticate(newUser);\n   traceLoginFor(authenticated);\n@@ -19,11 +21,6 @@ function traceLogin(user) {\n    // ...some code...\n }\n \n-// playChess seems like a very unrelated responsibility.\n-// Should it really be within the same module?\n-\n-export function playChess(loggedInUser) {\n-   var board = chessEngine.newBoard();\n-\n-   return newGameOn(board, loggedInUser);\n-}\n+// [Refactoring: moved playChess to a new chessGame.js module\n+// As a result of this refactoring, the module maintains a\n+// single behavior where all code and data is related: high cohesion.]\n","language":"python","improvement-type":"Low Cohesion"}],"change-level":"warning","is-hotspot?":false,"what-changed":"This module has at least 14 different responsibilities amongst its 25 functions, threshold = 4","how-to-fix":"Look to modularize the code by splitting the file into more cohesive units; functions that belong together should still be located together. A common refactoring is [EXTRACT CLASS](https://refactoring.com/catalog/extractClass.html).","change-type":"introduced"}]},"positive-impact-count":0,"repo":"satpy","code-health":7.353464552350734,"version":"3.0","authors":["Kamil Monicz"],"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":"2026-03-06T03:37:23.000Z","project-name":"satpy","repository":"https://github.com/pytroll/satpy.git"}}