{"results":{"result":{"added-files":{"code-health":10.0,"old-code-health":0.0,"files":[{"file":"lib/features/mailbox_dashboard/presentation/delegates/empty_folder_provider_listener_delegate.dart","loc":207,"code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/providers/empty_folder_provider.dart","loc":239,"code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/strategies/trash_folder_strategy.dart","loc":25,"code-health":10.0},{"file":"test/features/mailbox_dashboard/presentation/providers/empty_trash_notifier_test.dart","loc":363,"code-health":10.0},{"file":"test/features/mailbox_dashboard/presentation/strategies/trash_folder_strategy_test.dart","loc":74,"code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/dialogs/empty_trash_confirmation_dialog.dart","loc":39,"code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/extensions/map_mailbox_by_id_extension.dart","loc":6,"code-health":10.0},{"file":"lib/main/providers/app_toast_provider.dart","loc":5,"code-health":10.0}]},"external-review-url":"https://github.com/linagora/tmail-flutter/pull/4576","old-code-health":8.03124096033775,"modified-files":{"code-health":7.887693719816973,"old-code-health":8.03124096033775,"files":[{"file":"lib/features/base/base_controller.dart","loc":636,"old-loc":632,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/base/mixin/mailbox_action_handler_mixin.dart","loc":254,"old-loc":251,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox/presentation/model/mailbox_node.dart","loc":155,"old-loc":153,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/bindings/mailbox_dashboard_bindings.dart","loc":497,"old-loc":496,"code-health":9.141311567058597,"old-code-health":9.141311567058597},{"file":"lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart","loc":3158,"old-loc":3187,"code-health":6.678898261467314,"old-code-health":6.660906512860437},{"file":"lib/features/mailbox_dashboard/presentation/extensions/delete_emails_in_mailbox_extension.dart","loc":18,"old-loc":14,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view.dart","loc":66,"old-loc":60,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart","loc":888,"old-loc":880,"code-health":6.7847916917849656,"old-code-health":6.7518444789230365},{"file":"lib/features/thread/presentation/thread_view.dart","loc":827,"old-loc":831,"code-health":6.048019940142049,"old-code-health":5.990681814692565},{"file":"lib/main/localizations/app_localizations.dart","loc":5023,"old-loc":5005,"code-health":8.031638343271364,"old-code-health":8.545379580978913},{"file":"test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart","loc":640,"old-loc":644,"code-health":9.002431792017724,"old-code-health":8.997354731618337},{"file":"test/features/mailbox_dashboard/presentation/view/mailbox_dashboard_view_widget_test.dart","loc":902,"old-loc":903,"code-health":9.382488110562456,"old-code-health":9.377169927347584},{"file":"test/features/search/verify_before_time_in_search_email_filter_test.dart","loc":1077,"old-loc":1082,"code-health":6.690924517213949,"old-code-health":6.690924517213949},{"file":"test/fixtures/widget_fixtures.dart","loc":56,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox/data/repository/mailbox_repository_impl.dart","loc":299,"old-loc":286,"code-health":10.0,"old-code-health":10.0},{"file":"test/features/mailbox/repository/mailbox_respository_test.dart","loc":285,"old-loc":203,"code-health":10.0,"old-code-health":10.0},{"file":"model/lib/extensions/presentation_mailbox_extension.dart","loc":219,"old-loc":216,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"4576","analysis-time":"2026-06-11T08:59:42Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":3,"commits":["4ddce1796449bab5f94165cbfd50e71888be77b7","c54a3d56fc8af1d0bda533f22709e1e8bf2694e2","1b3e42a38767dc30223eaaa1e768f7c9d1577053","3aec006abe4a9e88476b5d0f709fe4e02347733f","782a1773e0ec15674b411d8f1258e49b431489d4","597738b27ea53a0677d3e7efab8c279cc8120d03","ad299de10284bcbfd361d07299086686aab4f38c","496909c202af92d5eb1ac1ece9378c214ad25cd7","f0da64ddc309b733f4f3a34bb165661730795534","cf6f0a61bbf93a68f385a4a2883efc65beb6097e"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"why-it-occurs":"This module has 5018 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":"lib/main/localizations/app_localizations.dart","refactoring-examples":null,"change-level":"warning","is-hotspot?":true,"what-changed":"The lines of code increases from 5000 to 5018, improve code health by reducing it to 5000","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":"degraded"}]},"positive-impact-count":8,"repo":"tmail-flutter","code-health":8.014500927262475,"version":"3.0","authors":["dab246"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":5,"number-of-files-touched":5,"findings":[{"name":"Lines of Declarations in a Single File","file":"lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart","change-type":"improved","change-level":"improvement","is-hotspot?":true,"what-changed":"The lines of data declarations decreases from 2533 to 2498, threshold = 1500"},{"name":"Low Cohesion","file":"lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart","change-type":"improved","change-level":"improvement","is-hotspot?":true,"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.","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).","what-changed":"The number of different responsibilities decreases from 6 to 5, threshold = 3"},{"method":"MailboxDashBoardController.handleSuccessViewState","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the Dart language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart","change-level":"improvement","is-hotspot?":true,"line":469,"what-changed":"MailboxDashBoardController.handleSuccessViewState decreases in cyclomatic complexity from 47 to 46, 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":"improved"},{"name":"Overall Code Complexity","file":"lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart","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 6.13 to 5.67, threshold = 4"},{"method":"setUp","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the Dart language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart","change-level":"improvement","is-hotspot?":false,"line":319,"what-changed":"setUp decreases from 75 to 74 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":"improved"},{"method":"'MailboxDashboardView'.setUp","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the Dart language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"test/features/mailbox_dashboard/presentation/view/mailbox_dashboard_view_widget_test.dart","change-level":"improvement","is-hotspot?":false,"line":328,"what-changed":"'MailboxDashboardView'.setUp decreases from 113 to 112 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":"improved"},{"method":"main","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the Dart language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"test/features/search/verify_before_time_in_search_email_filter_test.dart","change-level":"improvement","is-hotspot?":false,"line":190,"what-changed":"main decreases from 899 to 896 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":"improved"},{"method":"_extractBeforeFromFilter","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the Dart language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"test/features/search/verify_before_time_in_search_email_filter_test.dart","change-level":"improvement","is-hotspot?":false,"line":105,"what-changed":"_extractBeforeFromFilter decreases from 81 to 80 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":"improved"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-06-11T08:59:41.000Z","project-name":"james-project","repository":"https://github.com/linagora/tmail-flutter.git"}}