{"results":{"result":{"added-files":{"code-health":10.0,"old-code-health":0.0,"files":[{"file":"src/modules/actions/helpers/euDss.js","loc":49,"code-health":10.0},{"file":"src/modules/actions/helpers/euDss.spec.js","loc":104,"code-health":10.0},{"file":"src/modules/actions/signWithEuDss.jsx","loc":57,"code-health":10.0},{"file":"src/modules/actions/verifyWithEuDss.jsx","loc":61,"code-health":10.0}]},"external-review-url":"https://github.com/linagora/twake-drive/pull/3943","old-code-health":9.18843616183724,"modified-files":{"code-health":9.180934585694217,"old-code-health":9.18843616183724,"files":[{"file":"src/lib/flags.js","loc":29,"old-loc":28,"code-health":10.0,"old-code-health":10.0},{"file":"src/modules/views/Drive/DriveFolderView.jsx","loc":223,"old-loc":219,"code-health":9.07441935244369,"old-code-health":9.084674575222824}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"3943","analysis-time":"2026-06-22T07:54:10Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":1,"commits":["0a9758784cafda96cd20ad118730d0858c595fb6","0e3b6d7a4012228e4e1a10e6e9c992fef53da126"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"DriveFolderView","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the React language is a cyclomatic complexity lower than 10.","name":"Complex Method","file":"src/modules/views/Drive/DriveFolderView.jsx","refactoring-examples":[{"architectural-component-id":null,"author-name":"doubleface","training-data":{"loc-added":"1","loc-deleted":"3","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"mr.thiriot@gmail.com","commit-full-message":"","commit-date":"2026-06-11T12:08:23Z","current-rev":"4e5b7c962","filename":"twake-drive/src/modules/public/PublicToolbarByLink.jsx","previous-rev":"9196b60a4","commit-title":"feat: Move Download button in public page more menu","language":"React","id":"b79cb4c3e03e7bb9f11c52da99e6e5fc031d91b2","model-score":0.96,"author-id":null,"project-id":76928,"delta-file-score":0.31179166,"diff":"diff --git a/src/modules/public/PublicToolbarByLink.jsx b/src/modules/public/PublicToolbarByLink.jsx\nindex c6ef9e097..1d7f1ff02 100644\n--- a/src/modules/public/PublicToolbarByLink.jsx\n+++ b/src/modules/public/PublicToolbarByLink.jsx\n@@ -16,3 +16,2 @@ import AddButton from '@/modules/drive/Toolbar/components/AddButton'\n import ViewSwitcher from '@/modules/drive/Toolbar/components/ViewSwitcher'\n-import { DownloadFilesButton } from '@/modules/public/DownloadFilesButton'\n import PublicToolbarMoreMenu from '@/modules/public/PublicToolbarMoreMenu'\n@@ -39,3 +38,3 @@ const PublicToolbarByLink = ({\n     [\n-      isMobile && download,\n+      download,\n       files.length > 1 && select,\n@@ -80,3 +79,2 @@ const PublicToolbarByLink = ({\n             )}\n-            {files.length > 0 && <DownloadFilesButton files={files} />}\n             <ViewSwitcher className=\"u-ml-half\" />\n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"doubleface","training-data":{"loc-added":"8","loc-deleted":"3","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"christophe@cozycloud.cc","commit-full-message":"Use a ref to track nextCursor inside fetchMore so it does not need to\nbe listed as a dependency, preventing fetchMore from being recreated\non every page load.","commit-date":"2026-04-07T14:05:15Z","current-rev":"fe37361e4","filename":"twake-drive/src/modules/shareddrives/hooks/useSharedDriveFolder.tsx","previous-rev":"6ac8736f7","commit-title":"refactor: Stabilize fetchMore reference using a cursor ref","language":"React","id":"0725fbf036466b669c341d7308e240454398396e","model-score":0.92,"author-id":null,"project-id":76928,"delta-file-score":0.61278176,"diff":"diff --git a/src/modules/shareddrives/hooks/useSharedDriveFolder.tsx b/src/modules/shareddrives/hooks/useSharedDriveFolder.tsx\nindex df10a751e..d403e119b 100644\n--- a/src/modules/shareddrives/hooks/useSharedDriveFolder.tsx\n+++ b/src/modules/shareddrives/hooks/useSharedDriveFolder.tsx\n@@ -38,2 +38,3 @@ const useSharedDriveFolder = ({\n   const [nextCursor, setNextCursor] = useState<string | null>(null)\n+  const nextCursorRef = useRef<string | null>(null)\n   const isFetchingMore = useRef(false)\n@@ -61,2 +62,3 @@ const useSharedDriveFolder = ({\n       setSharedDriveResult({ data: undefined, included: undefined })\n+      nextCursorRef.current = null\n       setNextCursor(null)\n@@ -70,2 +72,3 @@ const useSharedDriveFolder = ({\n           setSharedDriveResult({ included })\n+          nextCursorRef.current = cursor\n           setNextCursor(cursor)\n@@ -76,2 +79,3 @@ const useSharedDriveFolder = ({\n           setSharedDriveResult({ data: undefined, included: undefined })\n+          nextCursorRef.current = null\n           setNextCursor(null)\n@@ -106,3 +110,3 @@ const useSharedDriveFolder = ({\n   const fetchMore = useCallback(async (): Promise<void> => {\n-    if (isFetchingMore.current || !nextCursor || !client) return\n+    if (isFetchingMore.current || !nextCursorRef.current || !client) return\n \n@@ -115,3 +119,3 @@ const useSharedDriveFolder = ({\n         folderId,\n-        nextCursor\n+        nextCursorRef.current\n       )\n@@ -125,2 +129,3 @@ const useSharedDriveFolder = ({\n       }))\n+      nextCursorRef.current = cursor\n       setNextCursor(cursor)\n@@ -131,3 +136,3 @@ const useSharedDriveFolder = ({\n     }\n-  }, [nextCursor, client, folderId, statById])\n+  }, [client, folderId, statById])\n \n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"Khaled FERJANI","training-data":{"loc-added":"2","loc-deleted":"9","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"9.536386775820924"},"author-email":"kferjani@linagora.com","commit-full-message":"Folder uploads used to recurse inside processNextFile via uploadDirectory,\nscattering 409 conflict handling across three places. The shape produced\nthe long-standing \"no internet connection\" symptom on folder re-drops:\nan inner-file 409 escaped the recursion and ended up in the file-overwrite\npath, which Chrome surfaced as \"Failed to fetch\".\n\nFolder uploads are now flattened at enqueue time. flattenEntries walks\nthe dropped tree once, creates intermediate folders server-side via\ncreateFolderOrGetExisting (handles 409 reuse), and turns each file into\nits own queue item with a relative path and target folder id.\nprocessNextFile only ever handles single files. Conflict handling\ncollapses into two parallel helpers: uploadOrOverwriteFile (file 409\n-> overwrite) and createFolderOrGetExisting (folder 409 -> reuse).\nError classification is one function (classifyUploadError); the\nprep-time alert routes through one handler (reportPrepError).\n\nTo keep folder drops responsive on deep trees, a placeholder row per\ntop-level folder is dispatched immediately so the upload tray reflects\nthe drop. flattenEntries runs in the background and a\nRESOLVE_FOLDER_ITEMS action swaps placeholders for the real per-file\nrows when it finishes.\n\nThe drive.enable-encryption flag was never enabled in production, so\nthe entire encryption code path - both write and read sides - is\nremoved in the same pass. Beyond cleanup, the encrypted upload\nbranch in uploadFile had a synchronous fr.readAsArrayBuffer that\nreturned undefined immediately, breaking conflict detection on\nencrypted uploads.\n\nWhat goes:\n\n- The flag itself.\n- The encryption write path: encryptAndUploadNewFile, createEncryptedDir,\n  AddEncryptedFolderItem, the related JSX gates in AddMenuContent, and\n  vaultClient threading through Dropzone, DropzoneDnD, UploadButton,\n  UploadItem, AddFolder, FolderPickerAddFolderItem, plus the createFolder\n  and uploadFiles actions.\n- The encryption read path: getEncryptionKeyFromDirId, decryptFile,\n  getDecryptedFileURL, downloadEncryptedFile, and the encryption branches\n  in downloadFiles, viewer/helpers downloadFile, FilesViewer, and\n  download.jsx.\n- src/lib/encryption.js entirely.\n- FolderUnlocker (the vault-unlock prompt) plus the wrappers in\n  FolderViewBody, FolderViewBodyContent and the four FolderPicker\n  Content* files.\n- The isEncrypted prop chain (getMimeTypeIcon, EncryptedFolderIcon,\n  FileIcon, FileThumbnail, AddFolderCard, AddFolderRow, SuggestionItem,\n  FolderPickerHeaderIllustration, useSearch).\n- The dead 'encrypted' branch in EmptyCanvas.\n- Stale translation keys (menu_new_encrypted_folder,\n  download.error.encryption_many) across 11 locales.\n\nFollow-up work folded into the same commit:\n\n- The file-limit guard moves into addToUploadQueue itself: the\n  navigation thunk no longer runs exceedsFileLimit ahead of the\n  queue, so a folder drop that trips the limit shows up in the\n  tray as a failed row before the modal appears, and prep-time\n  errors classify through the same RECEIVE_UPLOAD_ERROR path file\n  uploads already use.\n- The single-file download in actions/utils.js is now awaited\n  inside the try/catch so 404 and offline rejections reach the\n  catch arm again - collapsing the try block during the encrypted\n  cleanup had silently dropped the await and suppressed the\n  'This file is missing' / 'You should be connected' alerts.\n- A per-drop nonce scopes both folder-placeholder ids and flattened\n  file ids, so a folder dropped twice (or two files with the same\n  relative path) can't share a queue identity. The reducer's\n  by-fileId update would otherwise flip both rows on a single\n  dispatch.\n- The reducer no-ops same-reference returns when an UPLOAD_*\n  action's fileId matches nothing in state, and ignores\n  RESOLVE_FOLDER_ITEMS if the queue was purged while flatten was\n  in flight - so cancelled drops can't quietly re-fill the tray.\n- The flow inside addToUploadQueue runs the limit check before\n  kicking processing, so loose files don't begin uploading behind\n  the limit-exceeded modal. failPlaceholders -> failDrop now\n  applies to every row in the drop, including loose files.\n- overwriteFile passes the upload options at the top level of\n  updateFile's params (the rest of params is what cozy-stack-client\n  treats as upload options), so onUploadProgress reaches XHR on\n  conflict-overwrite paths and folder-uploaded files emit progress\n  events.\n- The runThunk test helper now drains promises returned by nested\n  thunks so any action dispatched after an inner thunk's first\n  await is captured before assertions run.\n\nSpecs cover the new placeholder-id shape, the no-op reducer, and\nthe overwrite onUploadProgress propagation.","commit-date":"2026-04-28T08:03:46Z","current-rev":"823594568","filename":"twake-drive/src/modules/filelist/icons/FileIconMime.jsx","previous-rev":"98d25068f","commit-title":"refactor: rework upload pipeline and drop the encrypted-folder feature","language":"React","id":"2f0d5d48e15bf735709e8ae170f9c59e90cb7f94","model-score":0.68,"author-id":null,"project-id":76928,"delta-file-score":0.29573047,"diff":"diff --git a/src/modules/filelist/icons/FileIconMime.jsx b/src/modules/filelist/icons/FileIconMime.jsx\nindex 27ce354bf..81537f5e0 100644\n--- a/src/modules/filelist/icons/FileIconMime.jsx\n+++ b/src/modules/filelist/icons/FileIconMime.jsx\n@@ -7,3 +7,2 @@ import Icon from 'cozy-ui/transpiled/react/Icon'\n \n-import { isEncryptedFolder } from '@/lib/encryption'\n import getMimeTypeIcon from '@/lib/getMimeTypeIcon'\n@@ -11,5 +10,4 @@ import { CustomizedIcon } from '@/modules/views/Folder/CustomizedIcon'\n \n-const FileIconMime = ({ file, size = 32, isEncrypted = false }) => {\n+const FileIconMime = ({ file, size = 32 }) => {\n   const isDir = isDirectory(file)\n-  const isDirEncrypted = isEncrypted || (isDirectory && isEncryptedFolder(file)) // use file.ref + file.type\n \n@@ -30,8 +28,3 @@ const FileIconMime = ({ file, size = 32, isEncrypted = false }) => {\n     return (\n-      <Icon\n-        icon={getMimeTypeIcon(isDir, file.name, file.mime, {\n-          isEncrypted: isDirEncrypted\n-        })}\n-        size={size}\n-      />\n+      <Icon icon={getMimeTypeIcon(isDir, file.name, file.mime)} size={size} />\n     )\n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"Crash--","training-data":{"loc-added":"1","loc-deleted":"13","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"quentin.valmori@gmail.com","commit-full-message":"On touch screens the editor opened in edit mode, which hid the Drive\ntoolbar (file name and back button) and left the read-only fab as the\nonly way out. The fab toggle was also immediately reverted to edit mode\nby the provider, so it could never restore the toolbar.\n\nAlways render the editor toolbar so the back-to-Drive control stays\navailable, and drop the now-redundant read-only fab.","commit-date":"2026-06-20T15:59:56Z","current-rev":"970343948","filename":"twake-drive/src/modules/views/OnlyOffice/View.jsx","previous-rev":"4d8bbda80","commit-title":"fix(onlyoffice): always show editor toolbar and remove read-only fab","language":"React","id":"f8b8eedcce05fbf1172dc1ab8f26d27ab859bbe7","model-score":0.59,"author-id":null,"project-id":76928,"delta-file-score":0.31179166,"diff":"diff --git a/src/modules/views/OnlyOffice/View.jsx b/src/modules/views/OnlyOffice/View.jsx\nindex 23308ec9f..957a3f95e 100644\n--- a/src/modules/views/OnlyOffice/View.jsx\n+++ b/src/modules/views/OnlyOffice/View.jsx\n@@ -4,3 +4,2 @@ import React, { useEffect, useCallback, useState } from 'react'\n import Spinner from 'cozy-ui/transpiled/react/Spinner'\n-import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'\n \n@@ -9,5 +8,3 @@ import OnlyOfficeAIAssistantPanel from '@/modules/views/OnlyOffice/OnlyOfficeAIA\n import { useOnlyOfficeContext } from '@/modules/views/OnlyOffice/OnlyOfficeProvider'\n-import ReadOnlyFab from '@/modules/views/OnlyOffice/ReadOnlyFab'\n import { FRAME_EDITOR_NAME } from '@/modules/views/OnlyOffice/config'\n-import { isOfficeEditingEnabled } from '@/modules/views/OnlyOffice/helpers'\n \n@@ -21,4 +18,3 @@ const View = ({ id, apiUrl, docEditorConfig }) => {\n \n-  const { isEditorReady, isReadOnly, isTrashed } = useOnlyOfficeContext()\n-  const { isMobile, isDesktop } = useBreakpoints()\n+  const { isEditorReady } = useOnlyOfficeContext()\n \n@@ -55,9 +51,2 @@ const View = ({ id, apiUrl, docEditorConfig }) => {\n \n-  const showReadOnlyFab =\n-    isMobile &&\n-    isEditorReady &&\n-    !isReadOnly &&\n-    !isTrashed &&\n-    isOfficeEditingEnabled(isDesktop)\n-\n   if (isError) return <Error />\n@@ -75,3 +64,2 @@ const View = ({ id, apiUrl, docEditorConfig }) => {\n       </div>\n-      {showReadOnlyFab && <ReadOnlyFab />}\n     </>\n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"doubleface","training-data":{"loc-added":"40","loc-deleted":"18","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.17","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"mr.thiriot@gmail.com","commit-full-message":"","commit-date":"2026-05-05T07:05:41Z","current-rev":"13bdeb6c8","filename":"twake-drive/src/components/Migration/MigrationProgressBanner.jsx","previous-rev":"1fbf1cbcc","commit-title":"refactor: extract banner logic into reusable hooks","language":"React","id":"e77f1c49afe95818963c3b68c706fa4977a1c78e","model-score":0.54,"author-id":null,"project-id":76928,"delta-file-score":0.36371157,"diff":"diff --git a/src/components/Migration/MigrationProgressBanner.jsx b/src/components/Migration/MigrationProgressBanner.jsx\nindex 88fb011c8..63a158f29 100644\n--- a/src/components/Migration/MigrationProgressBanner.jsx\n+++ b/src/components/Migration/MigrationProgressBanner.jsx\n@@ -17,10 +17,25 @@ const SNACKBAR_AUTO_HIDE_MS = 6000\n \n-const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n-  const { t } = useI18n()\n-  const client = useClient()\n-  const { showAlert } = useAlert()\n+const computeMigrationPercent = progress => {\n+  if (!progress?.bytes_total) return 0\n \n-  const migrationId = migrationDoc?._id\n+  return Math.round((progress.bytes_imported / progress.bytes_total) * 100)\n+}\n \n-  const [isCanceling, setIsCanceling] = useState(false)\n+const showCompletedMigrationAlert = ({ doc, showAlert, t }) => {\n+  if (doc.status !== 'completed') return\n+\n+  showAlert({\n+    title: t('MigrationProgressBanner.done.title'),\n+    message: t('MigrationProgressBanner.done.body', {\n+      count: doc.progress?.files_total ?? 0\n+    }),\n+    severity: 'success',\n+    duration: SNACKBAR_AUTO_HIDE_MS\n+  })\n+}\n+\n+const useMigrationCompletionAlert = ({ migrationId }) => {\n+  const client = useClient()\n+  const { showAlert } = useAlert()\n+  const { t } = useI18n()\n \n@@ -29,13 +44,4 @@ const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n \n-    const handleUpdate = doc => {\n-      if (doc.status === 'completed') {\n-        showAlert({\n-          title: t('MigrationProgressBanner.done.title'),\n-          message: t('MigrationProgressBanner.done.body', {\n-            count: doc.progress?.files_total ?? 0\n-          }),\n-          severity: 'success',\n-          duration: SNACKBAR_AUTO_HIDE_MS\n-        })\n-      }\n+    const handleMigrationUpdate = doc => {\n+      showCompletedMigrationAlert({ doc, showAlert, t })\n     }\n@@ -46,4 +52,5 @@ const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n       migrationId,\n-      handleUpdate\n+      handleMigrationUpdate\n     )\n+\n     return () => {\n@@ -53,3 +60,3 @@ const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n         migrationId,\n-        handleUpdate\n+        handleMigrationUpdate\n       )\n@@ -57,2 +64,7 @@ const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n   }, [client, migrationId, showAlert, t])\n+}\n+\n+const useMigrationCancel = ({ migrationId }) => {\n+  const client = useClient()\n+  const [isCanceling, setIsCanceling] = useState(false)\n \n@@ -60,3 +72,5 @@ const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n     if (!migrationId || isCanceling) return\n+\n     setIsCanceling(true)\n+\n     try {\n@@ -70,9 +84,19 @@ const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n     }\n-  }, [client, migrationId, isCanceling])\n+  }, [client, isCanceling, migrationId])\n+\n+  return { isCanceling, handleCancel }\n+}\n+\n+const DumbMigrationProgressBanner = ({ migrationDoc }) => {\n+  const { t } = useI18n()\n \n+  const migrationId = migrationDoc?._id\n   const progress = migrationDoc?.progress\n-  const percent =\n-    progress?.bytes_total > 0\n-      ? Math.round((progress.bytes_imported / progress.bytes_total) * 100)\n-      : 0\n+  const percent = computeMigrationPercent(progress)\n+\n+  useMigrationCompletionAlert({ migrationId })\n+\n+  const { isCanceling, handleCancel } = useMigrationCancel({\n+    migrationId\n+  })\n \n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"Théo Poizat","training-data":{"loc-added":"7","loc-deleted":"26","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"9.6882083290695"},"author-email":"hello@zatteo.com","commit-full-message":"New in stack for shared folder recipient:\n- download folder\n- download multiple files\n\nCan not download multiple share folders at same time.\n\nIt is not necessary to pass a driveId to downloadFiles because it can\nbe infered from the files passed to downloadFiles.","commit-date":"2026-03-23T10:09:41Z","current-rev":"2598dcf1f","filename":"twake-drive/src/modules/actions/download.jsx","previous-rev":"245b5989a","commit-title":"feat: Enable archive download for shared folder recipient","language":"React","id":"7f66850d1d867acfffa848c8cfc4700a95638f73","model-score":0.49,"author-id":null,"project-id":76928,"delta-file-score":0.44755203,"diff":"diff --git a/src/modules/actions/download.jsx b/src/modules/actions/download.jsx\nindex d6d54bdf2..715a44f89 100644\n--- a/src/modules/actions/download.jsx\n+++ b/src/modules/actions/download.jsx\n@@ -2,3 +2,2 @@ import React, { forwardRef } from 'react'\n \n-import { isDirectory } from 'cozy-client/dist/models/file'\n import ActionsMenuItem from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem'\n@@ -35,3 +34,3 @@ export const download = ({\n   showAlert,\n-  driveId,\n+  shouldHideIfSharedDriveRecipient,\n   isSelectAll,\n@@ -48,8 +47,8 @@ export const download = ({\n     displayCondition: files => {\n-      // # We cannot download folders or multiple files in shared drives\n-\n-      // ## For sharing tab\n+      // ## For sharing tab where we can see multiple shared folders as recipient,\n+      // we disable it because we can not download different shared folders at same time\n       if (\n-        driveId &&\n-        (files.length > 1 || (files.length === 1 && isDirectory(files[0])))\n+        shouldHideIfSharedDriveRecipient &&\n+        files.length > 1 &&\n+        files.some(file => isFromSharedDriveRecipient(file))\n       ) {\n@@ -58,15 +57,2 @@ export const download = ({\n \n-      // ## For shared drive view\n-      const isSingleSharedDriveFolder =\n-        files.length === 1 &&\n-        isFromSharedDriveRecipient(files[0]) &&\n-        isDirectory(files[0])\n-\n-      const hasMultipleFilesIncludeShareDriveFiles =\n-        files.length > 1 && files.some(file => isFromSharedDriveRecipient(file))\n-\n-      if (isSingleSharedDriveFolder || hasMultipleFilesIncludeShareDriveFiles) {\n-        return false\n-      }\n-\n       // We cannot generate archive for encrypted files, for now.\n@@ -85,8 +71,3 @@ export const download = ({\n       }\n-      return downloadFiles(\n-        client,\n-        selectedFiles,\n-        { vaultClient, showAlert, t },\n-        driveId\n-      )\n+      return downloadFiles(client, selectedFiles, { vaultClient, showAlert, t })\n     },\n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"Crash--","training-data":{"loc-added":"9","loc-deleted":"58","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"quentin.valmori@gmail.com","commit-full-message":"Extract the title bar, its leading cluster, the shared helpers and the\nloading spinner into a common editor module reused by the pdf and\nexcalidraw editors, and lower the cyclomatic complexity flagged by code\nhealth. Also fixes the root parent path (\"/\" instead of \"//\"), hides the\nopen/close entries in the editor document menu, and disables rsbuild\nlazy compilation in dev.","commit-date":"2026-06-11T08:39:11Z","current-rev":"423a2150c","filename":"twake-drive/src/modules/views/Pdf/Title.jsx","previous-rev":"d81edfeaf","commit-title":"refactor(editor): share the editor chrome across pdf and excalidraw","language":"React","id":"81e1696fc9145dbe29ee067384d0efa43b84426a","model-score":0.43,"author-id":null,"project-id":76928,"delta-file-score":0.31179166,"diff":"diff --git a/src/modules/views/Pdf/Title.jsx b/src/modules/views/Pdf/Title.jsx\nindex 89b30cab3..b4a26a497 100644\n--- a/src/modules/views/Pdf/Title.jsx\n+++ b/src/modules/views/Pdf/Title.jsx\n@@ -4,27 +4,6 @@ import React, { useCallback } from 'react'\n import Button from 'cozy-ui/transpiled/react/Buttons'\n-import { DialogTitle } from 'cozy-ui/transpiled/react/Dialog'\n-import Divider from 'cozy-ui/transpiled/react/Divider'\n-import Icon from 'cozy-ui/transpiled/react/Icon'\n import PdfIcon from 'cozy-ui/transpiled/react/Icons/FileTypePdf'\n-import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'\n-import { makeStyles } from 'cozy-ui/transpiled/react/styles'\n import { useI18n } from 'twake-i18n'\n \n-import BackButton from '@/components/EditorToolbar/BackButton'\n-import FileName from '@/components/EditorToolbar/FileName'\n-import HomeIcon from '@/components/EditorToolbar/HomeIcon'\n-import HomeLinker from '@/components/EditorToolbar/HomeLinker'\n-import Separator from '@/components/EditorToolbar/Separator'\n-import Sharing from '@/components/EditorToolbar/Sharing'\n-import { useRedirectLink } from '@/hooks/useRedirectLink'\n-\n-// Match the OnlyOffice and Excalidraw editors: keep the title bar a fixed 3rem\n-// tall on its paper background.\n-const useStyles = makeStyles(theme => ({\n-  root: {\n-    width: '100%',\n-    height: '3rem',\n-    backgroundColor: theme.palette.background.paper\n-  }\n-}))\n+import EditorTitle from '@/modules/views/editor/EditorTitle'\n \n@@ -32,11 +11,2 @@ const Title = ({ file, flushRef, isPublic = false, isReadOnly = false }) => {\n   const { t } = useI18n()\n-  const { isMobile } = useBreakpoints()\n-  const { redirectBack, canRedirect } = useRedirectLink({ isPublic })\n-  const styles = useStyles()\n-\n-  // Force a save of any pending change before leaving the editor.\n-  const handleBack = useCallback(async () => {\n-    await flushRef?.current?.()\n-    redirectBack()\n-  }, [flushRef, redirectBack])\n \n@@ -47,38 +17,19 @@ const Title = ({ file, flushRef, isPublic = false, isReadOnly = false }) => {\n   return (\n-    <div style={{ zIndex: 'var(--zIndex-nav)' }}>\n-      <DialogTitle\n-        data-testid=\"pdf-title\"\n-        disableTypography\n-        className=\"u-ellipsis u-flex u-flex-items-center u-p-0 u-pr-1\"\n-        classes={styles}\n-      >\n-        <div className=\"u-flex u-flex-items-center u-flex-grow-1 u-ellipsis\">\n-          {!isMobile && (\n-            <>\n-              {isPublic ? (\n-                <HomeIcon />\n-              ) : (\n-                <HomeLinker>\n-                  <HomeIcon />\n-                </HomeLinker>\n-              )}\n-              <Separator />\n-            </>\n-          )}\n-          {canRedirect && <BackButton onClick={handleBack} />}\n-          {!isMobile && <Icon className=\"u-ml-half\" icon={PdfIcon} size={32} />}\n-          <FileName file={file} isPublic={isPublic} isReadOnly={isReadOnly} />\n-        </div>\n-        {!isReadOnly && (\n-          <Button\n-            variant=\"secondary\"\n-            label={t('Pdf.save')}\n-            onClick={handleSave}\n-            className=\"u-mr-half\"\n-          />\n-        )}\n-        {!isPublic && <Sharing file={file} />}\n-      </DialogTitle>\n-      <Divider />\n-    </div>\n+    <EditorTitle\n+      file={file}\n+      flushRef={flushRef}\n+      icon={PdfIcon}\n+      dataTestId=\"pdf-title\"\n+      isPublic={isPublic}\n+      isReadOnly={isReadOnly}\n+    >\n+      {!isReadOnly && (\n+        <Button\n+          variant=\"secondary\"\n+          label={t('Pdf.save')}\n+          onClick={handleSave}\n+          className=\"u-mr-half\"\n+        />\n+      )}\n+    </EditorTitle>\n   )\n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"Crash--","training-data":{"loc-added":"4","loc-deleted":"40","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.35","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"quentin.valmori@gmail.com","commit-full-message":"Group the note/docs/excalidraw/office create entries into a\nCreateDocumentItems component so AddMenuContent drops back below the\ncyclomatic-complexity threshold; table-drive the related menu tests.","commit-date":"2026-06-05T11:22:14Z","current-rev":"b75038ace","filename":"twake-drive/src/modules/drive/AddMenu/AddMenuContent.jsx","previous-rev":"95179a95f","commit-title":"refactor(drive): extract document-create items from the add menu","language":"React","id":"f4b7070c3b0645e60dc8ab10791a11f0a9bf48a2","model-score":0.42,"author-id":null,"project-id":76928,"delta-file-score":0.41834745,"diff":"diff --git a/src/modules/drive/AddMenu/AddMenuContent.jsx b/src/modules/drive/AddMenu/AddMenuContent.jsx\nindex 7e8f9eca7..54388580c 100644\n--- a/src/modules/drive/AddMenu/AddMenuContent.jsx\n+++ b/src/modules/drive/AddMenu/AddMenuContent.jsx\n@@ -2,3 +2,2 @@ import React, { forwardRef } from 'react'\n \n-import flag from 'cozy-flags'\n import ActionsMenuMobileHeader from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuMobileHeader'\n@@ -7,3 +6,2 @@ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'\n import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'\n-import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'\n import { useI18n } from 'twake-i18n'\n@@ -11,6 +9,3 @@ import { useI18n } from 'twake-i18n'\n import AddFolderItem from '@/modules/drive/Toolbar/components/AddFolderItem'\n-import CreateDocsItem from '@/modules/drive/Toolbar/components/CreateDocsItem'\n-import CreateExcalidrawItem from '@/modules/drive/Toolbar/components/CreateExcalidrawItem'\n-import CreateNoteItem from '@/modules/drive/Toolbar/components/CreateNoteItem'\n-import CreateOnlyOfficeItem from '@/modules/drive/Toolbar/components/CreateOnlyOfficeItem'\n+import CreateDocumentItems from '@/modules/drive/Toolbar/components/CreateDocumentItems'\n import CreateShortcut from '@/modules/drive/Toolbar/components/CreateShortcut'\n@@ -21,3 +16,2 @@ import { isFromSharedDriveRecipient } from '@/modules/shareddrives/helpers'\n import { NewItemHighlightProvider } from '@/modules/upload/NewItemHighlightProvider'\n-import { isOfficeEditingEnabled } from '@/modules/views/OnlyOffice/helpers'\n \n@@ -38,3 +32,2 @@ const AddMenuContent = forwardRef(\n     const { t } = useI18n()\n-    const { isDesktop } = useBreakpoints()\n     const { hasScanner } = useScannerContext()\n@@ -69,38 +62,9 @@ const AddMenuContent = forwardRef(\n         )}\n-        {!isPublic && (\n-          <CreateNoteItem\n-            displayedFolder={displayedFolder}\n-            isReadOnly={isReadOnly}\n-            onClick={onClick}\n-          />\n-        )}\n-        {!isPublic && flag('drive.lasuitedocs.enabled') && (\n-          <CreateDocsItem\n-            displayedFolder={displayedFolder}\n-            isReadOnly={isReadOnly}\n-            onClick={onClick}\n-          />\n-        )}\n-        {flag('drive.excalidraw.enabled') && (!isPublic || canUpload) && (\n-          <CreateExcalidrawItem isReadOnly={isReadOnly} onClick={onClick} />\n-        )}\n-        {canUpload && isOfficeEditingEnabled(isDesktop) && (\n-          <>\n-            <CreateOnlyOfficeItem\n-              fileClass=\"text\"\n-              isReadOnly={isReadOnly}\n-              onClick={onClick}\n-            />\n-            <CreateOnlyOfficeItem\n-              fileClass=\"spreadsheet\"\n-              isReadOnly={isReadOnly}\n-              onClick={onClick}\n-            />\n-            <CreateOnlyOfficeItem\n-              fileClass=\"slide\"\n-              isReadOnly={isReadOnly}\n-              onClick={onClick}\n-            />\n-          </>\n-        )}\n+        <CreateDocumentItems\n+          isPublic={isPublic}\n+          canUpload={canUpload}\n+          displayedFolder={displayedFolder}\n+          isReadOnly={isReadOnly}\n+          onClick={onClick}\n+        />\n         {!isFromSharedDriveRecipient(displayedFolder) && (\n","improvement-type":"Complex Method"},{"architectural-component-id":null,"author-name":"Khaled FERJANI","training-data":{"loc-added":"8","loc-deleted":"39","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"9.6882083290695"},"author-email":"kferjani@linagora.com","commit-full-message":"The shared-drives-dir folder is hidden from the normal file list but was\nmanually injected at the root of the move/copy destination picker, so it\nshowed up as a target there. Drop the injection and rely on the existing\nbuildMoveOrImportQuery filter.","commit-date":"2026-06-10T12:55:30Z","current-rev":"11d2caf7f","filename":"twake-drive/src/components/FolderPicker/FolderPickerContentCozy.tsx","previous-rev":"f29ad889e","commit-title":"fix(folderpicker): hide Drives folder in move/copy picker","language":"React","id":"89c8e1e6969d0abaec7456a2a8b02421558c2314","model-score":0.33,"author-id":null,"project-id":76928,"delta-file-score":0.59155285,"diff":"diff --git a/src/components/FolderPicker/FolderPickerContentCozy.tsx b/src/components/FolderPicker/FolderPickerContentCozy.tsx\nindex 72286fe40..80f23e413 100644\n--- a/src/components/FolderPicker/FolderPickerContentCozy.tsx\n+++ b/src/components/FolderPicker/FolderPickerContentCozy.tsx\n@@ -1,2 +1,2 @@\n-import React, { useMemo } from 'react'\n+import React from 'react'\n \n@@ -15,4 +15,3 @@ import { computeNextcloudRootFolder } from '@/components/FolderPicker/helpers'\n import type { File, FolderPickerEntry } from '@/components/FolderPicker/types'\n-import { ROOT_DIR_ID } from '@/constants/config'\n-import { buildMoveOrImportQuery, buildMagicFolderQuery } from '@/queries'\n+import { buildMoveOrImportQuery } from '@/queries'\n \n@@ -33,5 +32,3 @@ const FolderPickerContentCozy: React.FC<FolderPickerContentCozyProps> = ({\n   entries,\n-  navigateTo,\n-  showNextcloudFolder,\n-  showSharedDriveFolder\n+  navigateTo\n }) => {\n@@ -50,35 +47,7 @@ const FolderPickerContentCozy: React.FC<FolderPickerContentCozyProps> = ({\n \n-  const sharedFolderQuery = buildMagicFolderQuery({\n-    id: 'io.cozy.files.shared-drives-dir',\n-    enabled: folder._id === ROOT_DIR_ID\n-  })\n-  const sharedFolderResult = useQuery(\n-    sharedFolderQuery.definition,\n-    sharedFolderQuery.options\n-  ) as unknown as {\n-    fetchStatus: string\n-    data?: IOCozyFile[]\n-  }\n-\n-  const files: IOCozyFile[] = useMemo(() => {\n-    if (\n-      folder._id === ROOT_DIR_ID &&\n-      (showNextcloudFolder || showSharedDriveFolder)\n-    ) {\n-      return [\n-        ...(sharedFolderResult.fetchStatus === 'loaded'\n-          ? (sharedFolderResult.data ?? [])\n-          : []),\n-        ...(filesData ?? [])\n-      ]\n-    }\n-    return [...(filesData ?? [])]\n-  }, [\n-    folder._id,\n-    showNextcloudFolder,\n-    showSharedDriveFolder,\n-    filesData,\n-    sharedFolderResult.fetchStatus,\n-    sharedFolderResult.data\n-  ])\n+  // The \"Drives\" folder (shared-drives-dir) is hidden from the normal file\n+  // list, so it must not appear as a destination in the move/copy picker.\n+  // buildMoveOrImportQuery already excludes it via partialIndex, so the list\n+  // is used as-is with no manual injection.\n+  const files: IOCozyFile[] = filesData ?? []\n \n","improvement-type":"Complex Method"}],"change-level":"warning","is-hotspot?":true,"line":56,"what-changed":"DriveFolderView already has high cyclomatic complexity, and now it increases in Lines of Code from 169 to 171","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":"degraded"}]},"positive-impact-count":0,"repo":"twake-drive","code-health":9.60534515410123,"version":"3.0","authors":["Crash--"],"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-06-22T07:54:09.000Z","project-name":"twake-drive","repository":"https://github.com/linagora/twake-drive.git"}}