Conversation
|
React Doctor found 7 new issues in 4 files · 7 warnings · score 89 / 100 (Great) · 3 fixed · vs 7 warnings
Reviewed by React Doctor for commit |
|
Preview deployment ready: https://feat-issue-269-evidence-disc.comapeo-cloud-app.pages.dev Commit: |
…ue-269-evidence-disclosure
…ue-269-evidence-disclosure
…ce-disclosure # Conflicts: # src/i18n/messages/es.json # src/i18n/messages/pt.json
| onAdded?: (caseLocalId: string) => void; | ||
| } | ||
|
|
||
| export function AddToCaseDialog({ |
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
AddToCaseDialog has cyclomatic complexity 14, cognitive complexity 16, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
| setSubmitError(false); | ||
| try { | ||
| for (const source of sources) { | ||
| await addEvidence.mutateAsync({ |
There was a problem hiding this comment.
React Doctor · react-doctor/async-await-in-loop (warning)
This makes the for…of loop slow because each await runs one after another, so collect the independent calls & run them together with await Promise.all(items.map(...))
Fix → Collect the items, then use await Promise.all(items.map(...)) so independent work runs at the same time
| caseLocalId: string; | ||
| } | ||
|
|
||
| export function CaseEvidenceWorkspace({ |
There was a problem hiding this comment.
React Doctor · react-doctor/no-giant-component (warning)
Component "CaseEvidenceWorkspace" is over 300 lines long, which is hard to read & change. Split it into a few smaller components.
Fix → Pull each section into its own component so the parent is easier to read, test, and change.
| return nextIds; | ||
| } | ||
|
|
||
| export function DataScreen() { |
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
DataScreen has cyclomatic complexity 18, cognitive complexity 22, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
Summary
Privacy and safety
QA
Implementation-specific QA: docs/qa/269.md
Runnable QA script: scripts/qa/269-evidence-disclosure.sh
Local evidence before push on synchronized main:
Closes #269