Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8e1ac55 to
75c6bf4
Compare
There was a problem hiding this comment.
Gates Failed
New code is healthy
(1 new file with code health below 10.00)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| New code is healthy | Violations | Code Health Impact | |
|---|---|---|---|
| FilePickerBodyItem.jsx | 1 rule | 9.69 | Suppress |
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
| const FilePickerBodyItem = ({ | ||
| item, | ||
| itemTypesAccepted, | ||
| multiple, | ||
| handleChoiceClick, | ||
| handleListItemClick, | ||
| itemsIdsSelected, | ||
| hasDivider | ||
| }) => { | ||
| const classes = useStyles() | ||
| const { f } = useI18n() | ||
| const hasChoice = | ||
| isValidFile(item, itemTypesAccepted) || | ||
| isValidFolder(item, itemTypesAccepted) | ||
|
|
||
| const Input = multiple ? Checkbox : Radio | ||
|
|
||
| const listItemSecondaryContent = isFile(item) | ||
| ? `${f(item.updated_at, 'dd LLL yyyy')} - ${filesize(item.size, { | ||
| base: 10 | ||
| })}` | ||
| : null | ||
|
|
||
| return ( | ||
| <> | ||
| <ListItem | ||
| disabled={!hasChoice && isFile(item)} | ||
| size="small" | ||
| button | ||
| data-testid="list-item" | ||
| > | ||
| <div | ||
| data-testid="listitem-onclick" | ||
| className={styles['filePickerBreadcrumb-wrapper']} | ||
| onClick={handleListItemClick(item)} | ||
| > | ||
| <ListItemIcon> | ||
| <Icon | ||
| icon={isDirectory(item) ? FileTypeFolder : FileTypeText} | ||
| width="32" | ||
| height="32" | ||
| /> | ||
| </ListItemIcon> | ||
| <ListItemText | ||
| primary={item.name} | ||
| secondary={listItemSecondaryContent} | ||
| /> | ||
| </div> | ||
| {isDirectory(item) && hasChoice && ( | ||
| <Divider | ||
| orientation="vertical" | ||
| flexItem | ||
| className={classes.verticalDivider} | ||
| /> | ||
| )} | ||
| <div | ||
| data-testid="choice-onclick" | ||
| className="u-pv-half u-h-2 u-flex u-flex-items-center" | ||
| onClick={hasChoice ? handleChoiceClick(item) : undefined} | ||
| > | ||
| <Input | ||
| data-testid={multiple ? 'checkbox-btn' : 'radio-btn'} | ||
| onChange={() => { | ||
| // handled by onClick on the container | ||
| }} | ||
| checked={itemsIdsSelected.includes(item._id)} | ||
| value={item._id} | ||
| className={cx('u-p-0', { | ||
| 'u-o-100': hasChoice, | ||
| 'u-o-0': !hasChoice | ||
| })} | ||
| disabled={!hasChoice} | ||
| /> | ||
| </div> | ||
| </ListItem> | ||
| {hasDivider && <Divider component="li" />} | ||
| </> | ||
| ) | ||
| } |
There was a problem hiding this comment.
❌ New issue: Complex Method
FilePickerBodyItem has a cyclomatic complexity of 11, threshold = 10
No description provided.