Showing 48 of 179 total issues
Function usePromise
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const usePromise = <TResult>(
promise: () => Promise<TResult | undefined>,
dependencies: DependencyList,
config?: UsePromiseConfig<TResult>,
): [TResult | undefined, Error | undefined, UsePromiseState | undefined] => {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function InvertibleThemeProvider
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const InvertibleThemeProvider: React.FC<InvertibleThemeProviderProps> = ({
options,
children,
dark,
resolve = false,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function BasePage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const BasePage: React.FC<BasePageProps> = ({
disableGutters,
children,
beta,
container,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Experiments
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Experiments: React.FC<ExperimentsProps> = (props) => {
const {
name, children, localStorageProp = true,
} = props
const userEvents = useUserEvents()
Function useNavigateToEthAddress
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const useNavigateToEthAddress = () => {
const navigate = useNavigate()
const navigateToEthAddress = (
address: EthAddress,
event: React.MouseEvent,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function CookieConsentBody
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const CookieConsentBody: React.FC<CookieConsentProps> = ({
acceptOnScroll, acceptOnTimer = 0, onAccept, ...props
}) => {
const {
accepted, setAccepted, storageName,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function calculateExperiment
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
calculateExperiment: (name: string, localStorageProp: string | boolean, variants: VariantData[], userEvents: UserEventHandler<UserEventsProps>) => {
const localStorageKey = ExperimentsHelper.buildLocalStorageKey(localStorageProp)
const totalWeight = ExperimentsHelper.calcTotalWeight(variants)
ExperimentsHelper.loadOutcomes()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function View
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const View: React.FC = () => {
const [storedBoolean, setStoredBoolean] = useLocalStorage<boolean>('test_boolean', false)
const [defaultObject, setDefaultObject] = useLocalStorage<object | undefined>('test_object', { bar: true, foo: false })
Function localOnClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {
if (busy) {
// If it is busy, do not allow href clicks
event.preventDefault()
} else {
Function useEthWallet
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useEthWallet = (connector: EthWalletConnectorBase): EthWallet => {
const [currentAccount, additionalAccounts] = useCurrentAccount(connector)
const chainId = useChainId(connector)
Function NumberStatus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const NumberStatus: React.FC<NumberStatusProps> = ({
error,
format = '0[.]0a',
color = 'primary',
title,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Outer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Outer: FC = () => {
const [outerValue, setOuterValue] = useState<boolean>()
return (
<div style={{ border: 'solid 1px yellow' }}>
<div>Outer</div>
Function useRenderSpinCheck
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useRenderSpinCheck = (bounce: RenderSpinCheckBounce, config?: RenderSpinCheckConfig) => {
const startTime = useMemo(() => Date.now(), [])
const [error, setError] = useState<Error>()
useEffect(() => {
Function useBusyTiming
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useBusyTiming = (busy?: boolean, busyMinimum = 0) => {
const [internalBusy, setInternalBusy] = useState(false)
const [busyStart, setBusyStart] = useState(0)
const timer = useMemo(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function calcSpacing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const calcSpacing = (theme: Theme, values: BoxProps['margin'][]) => {
for (const value of values) {
if (value !== undefined) {
if (typeof value === 'string') {
return value
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getSelectedVariant
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getSelectedVariant: (name: string) => {
const outcomes = ExperimentsHelper.loadOutcomes()
const experiment = ExperimentsHelper.getExperiment(name)
let total = 0
if (experiment && outcomes) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return 'xl'
Avoid too many return
statements within this function. Open
return defaultValue
Avoid too many return
statements within this function. Open
return <InfuraEthersLoader>{children}</InfuraEthersLoader>
Avoid too many return
statements within this function. Open
return <OperaEthersLoader>{children}</OperaEthersLoader>