{"results":{"result":{"added-files":{"code-health":10.0,"old-code-health":0.0,"files":[{"file":"lib/features/mailbox/presentation/model/mailbox_collection.dart","loc":42,"code-health":10.0}]},"external-review-url":"https://github.com/linagora/tmail-flutter/pull/4290","old-code-health":8.635030732135537,"modified-files":{"code-health":8.738824663695494,"old-code-health":8.635030732135537,"files":[{"file":"lib/features/base/base_mailbox_controller.dart","loc":644,"old-loc":622,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox/presentation/extensions/handle_action_required_tab_extension.dart","loc":94,"old-loc":53,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox/presentation/extensions/handle_favorite_tab_extension.dart","loc":58,"old-loc":41,"code-health":10.0,"old-code-health":10.0},{"file":"lib/features/mailbox/presentation/mailbox_controller.dart","loc":1484,"old-loc":1457,"code-health":6.872748222317765,"old-code-health":6.747384661924534},{"file":"lib/features/mailbox/presentation/model/mailbox_tree_builder.dart","loc":161,"old-loc":167,"code-health":10.0,"old-code-health":9.536386775820924},{"file":"lib/features/mailbox_creator/presentation/mailbox_creator_controller.dart","loc":223,"old-loc":219,"code-health":9.842730062691357,"old-code-health":9.842730062691357},{"file":"lib/features/search/mailbox/presentation/search_mailbox_controller.dart","loc":834,"old-loc":831,"code-health":9.11380182785474,"old-code-health":9.11380182785474},{"file":"test/features/mailbox/presentation/model/mailbox_tree_builder_test.dart","loc":652,"old-loc":555,"code-health":9.387218218812514,"old-code-health":9.096655465156704},{"file":"test/features/mailbox_dashboard/presentation/view/mailbox_dashboard_view_widget_test.dart","loc":901,"old-loc":908,"code-health":9.377169927347584,"old-code-health":9.377169927347584},{"file":"test/features/rule_filter_creator/presentation/rule_filter_creator_controller_test.dart","loc":288,"old-loc":291,"code-health":8.7579534928254,"old-code-health":8.73828440635323}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"4290","analysis-time":"2026-04-10T07:04:36Z","negative-impact-count":0,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":1,"commits":["e26bf41d1d06de971bca3493a6e21db61a3ff6bb","dfb24c2f249bfedf27f26644afd7573b616ba8ff","aa7cdb83c689282988b09fa3e5e99eb6c97aa07d"],"is-negative-review":false,"negative-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"positive-impact-count":5,"repo":"tmail-flutter","code-health":8.748668440711809,"version":"3.0","authors":["dab246"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":5,"number-of-files-touched":4,"findings":[{"method":"MailboxController._registerObxStreamListener","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/presentation/mailbox_controller.dart","change-level":"improvement","is-hotspot?":true,"line":296,"what-changed":"MailboxController._registerObxStreamListener decreases in cyclomatic complexity from 32 to 22, 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"},{"method":"TreeBuilder.generateMailboxTreeInUI","why-it-occurs":"A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health.\n\nA bumpy code road represents a lack of encapsulation which becomes an obstacle to comprehension. In imperative languages there’s also an increased risk for feature entanglement, which leads to complex state management. CodeScene considers the following rules for the code health impact: 1) The deeper the nested conditional logic of each bump, the higher the tax on our working memory. 2) The more bumps inside a function, the more expensive it is to refactor as each bump represents a missing abstraction. 3) The larger each bump – that is, the more lines of code it spans – the harder it is to build up a mental model of the function. The nesting depth for what is considered a bump is  levels of conditionals.","name":"Bumpy Road Ahead","file":"lib/features/mailbox/presentation/model/mailbox_tree_builder.dart","change-level":"improvement","is-hotspot?":false,"line":40,"what-changed":"TreeBuilder.generateMailboxTreeInUI is no longer above the threshold for logical blocks with deeply nested code","how-to-fix":"Bumpy Road implementations indicate a lack of encapsulation. Check out the detailed description of the [Bumpy Road code health issue](https://codescene.com/blog/bumpy-road-code-complexity-in-context/).\n\nA Bumpy Road often suggests that the function/method does too many things. The first refactoring step is to identify the different possible responsibilities of the function. Consider extracting those responsibilities into smaller, cohesive, and well-named functions. The [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring is the primary response.","change-type":"fixed"},{"method":"TreeBuilder.generateMailboxTreeInUI","why-it-occurs":"Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.\n\nThe threshold for the Dart language is 4 function arguments.","name":"Excess Number of Function Arguments","file":"lib/features/mailbox/presentation/model/mailbox_tree_builder.dart","change-level":"improvement","is-hotspot?":false,"line":40,"what-changed":"TreeBuilder.generateMailboxTreeInUI is no longer above the threshold for number of arguments","how-to-fix":"Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring [INTRODUCE PARAMETER OBJECT](https://refactoring.com/catalog/introduceParameterObject.html) to encapsulate arguments that refer to the same logical concept.","change-type":"fixed"},{"name":"Code Duplication","file":"test/features/mailbox/presentation/model/mailbox_tree_builder_test.dart","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.","how-to-fix":"A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. [Read More](https://codescene.com/blog/software-revolution-part3/)\n\nOnce you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.","what-changed":"reduced similar code in: 'Virtual Folders Exclusion & Sorting Impact'.'generateMailboxTreeInUI: Trees and nested sub-trees must exclude virtual folders','Virtual Folders Exclusion & Sorting Impact'.'generateMailboxTreeInUIAfterRefreshChanges: Trees and nested sub-trees must exclude virtual folders'"},{"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/rule_filter_creator/presentation/rule_filter_creator_controller_test.dart","change-level":"improvement","is-hotspot?":false,"line":57,"what-changed":"main decreases from 238 to 234 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-04-10T07:04:35.000Z","project-name":"james-project","repository":"https://github.com/linagora/tmail-flutter.git"}}