src/Tabs/Tabs.tsx

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Function Tab has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const Tab: FC<TabProps> = ({ test = 'tabs-tab', children, index, disabled, ...rest }) => {
const { activeIndex, setActiveIndex, ...context } = useTabsContext()
if (index === undefined) return null
 
if (disabled === true && !context.disabledTabs.includes(activeIndex)) {
Severity: Minor
Found in src/Tabs/Tabs.tsx - About 35 mins to fix

Function TabList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const TabList: FC<TabListProps> = ({ children }) => {
const { activeIndex, setActiveIndex, disabledTabs } = useTabsContext()
const [focused, setFocused] = useState(false)
 
const tabAmount = React.Children.count(children)
Severity: Minor
Found in src/Tabs/Tabs.tsx - About 25 mins to fix

There are no issues that match your filters.

Category
Status