in challenge5/frontend/components/ui/chart.tsx [27:35]
7 lines of code
2 McCabe index (conditional complexity)
function useChart() {
const context = React.useContext(ChartContext)
if (!context) {
throw new Error('useChart must be used within a <ChartContainer />')
}
return context
}