mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-06 16:04:20 +00:00
Problem: CodeScene flags handleDrivePickResult twice — cyclomatic complexity 9 (threshold 9) and a complex conditional with 2 branches (threshold 2). Both come from the same cause: the entry point decides which toast to show as well as what to attach. Decision: keep the entry point to the pick flow (split, insert, transfer) and move each toast decision to its own named method. The dropped-docs conditional is split as `droppedCount == 0 || !attachedAny` inside _showDroppedDocsFailure, with the two-list check passed in as one argument, so no single expression chains two operators. Behaviour is unchanged — all 29 handler tests pass untouched. Addresses: 3860581376, 3860587468 https://github.com/linagora/tmail-flutter/pull/4767#discussion_r3860581376 https://github.com/linagora/tmail-flutter/pull/4767#discussion_r3860587468