Showing 48 of 179 total issues
Function MyEtherWalletEthersLoader
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const MyEtherWalletEthersLoader: React.FC<PropsWithChildren<Props>> = (props) => {
const { children } = props
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const global = globalThis as any
const ethereum = global.ethereum
Function ButtonExBase
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const ButtonExBase = forwardRef<HTMLButtonElement, ButtonExProps>(({
funnel, intent, target, placement, disableUserEvents, href, ...props
}, ref) => {
const theme = useTheme()
const userEvents = useUserEvents()
- 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
GoogleStandardEvents
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
export class GoogleStandardEvents<T extends EmptyObject> {
addPaymentInfo() {
return new GoogleStandardEvent<GoogleBaseProperties | GoogleAddPaymentInfoProperties | T>('add_paymennt_info')
}
SnapchatStandardEvents
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
export class SnapchatStandardEvents<T extends SnapchatStandardProperties> {
achievementUnlocked() {
return new SnapchatStandardEvent<T>('ACHIEVEMENT_UNLOCKED')
}
Function usePromise
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const usePromise = <TResult>(
promise: () => Promise<TResult | undefined>,
dependencies: DependencyList,
config?: UsePromiseConfig<TResult>,
): [TResult | undefined, Error | undefined, UsePromiseState | undefined] => {
Function mergeBoxlikeStyles
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mergeBoxlikeStyles = <T extends BoxlikeComponentProps>(theme: Theme, props: BoxlikeComponentProps, defaultProps?: BoxlikeComponentProps): T => {
const {
alignContent,
alignItems,
alignSelf,
Function Template
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Template: StoryFn<WalletDiscoveryPaperProps> = (args: WalletDiscoveryPaperProps) => {
const [selectedWallet, setSelectedWallet] = useState<EIP6963Connector | undefined>()
const [errorArray, setErrorArray] = useState<[string, Error][]>([])
useEffect(() => {
Function PixelDebugger
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PixelDebugger: React.FC = () => {
const { isDebugging } = useContext(DebugUserEventsContext)
// TODO - when adding in the location hook to detect location change, was dropping the setEvents in usePixelAltSendHand
const theme = useTheme()
const [displayEvents, setDisplayEvents] = useState(false)
Function updateCanvas
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const updateCanvas = (canvas: React.RefObject<HTMLCanvasElement>, props: IdenticonProps) => {
const {
value = '', size = 400, bg = 'transparent', count = 5, palette, iconPadding = 0,
} = props
let { fg } = props
- 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 EthAccountBox
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const EthAccountBox: React.FC<EthAccountProps & FlexBoxProps> = ({
address,
icon = false,
iconSize = 16,
iconOnly = 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 useBusyTiming
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useBusyTiming = (busy?: boolean, busyMinimum = 0) => {
const [internalBusy, setInternalBusy] = useState(false)
const [busyStart, setBusyStart] = useState(0)
const timer = useMemo(
Function DarkModeIconButton
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const DarkModeIconButton: React.FC<DarkModeIconButtonProps> = ({
darkMode,
defaultDarkModeColor,
defaultLightModeColor,
toggleMode,
- 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 OperaEthersLoader
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const OperaEthersLoader: React.FC<PropsWithChildren<Props>> = (props) => {
const { children } = props
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const global = globalThis as any
const ethereum = global.ethereum
Function ExperimentsDebugger
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ExperimentsDebugger: React.FC = ({ ...props }) => {
const [experiments] = useLocalStorage<ExperimentsData>(ExperimentsLocalStorageKey, {})
const [outcomes, setOutcomes] = useLocalStorage<OutcomesData>(OutcomesLocalStorageKey, {})
const sumUpVariants = (items: VariantData[]) => items.reduce((acc, curr) => acc + curr.weight, 0)
Function TrustEthersLoader
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const TrustEthersLoader: React.FC<PropsWithChildren<Props>> = (props) => {
const { children } = props
const [error, setError] = useState<Error>()
const [signer, setSigner] = useState<JsonRpcSigner>()
const [localAddress, setLocalAddress] = useState<EthAddress>()
Function LinkToEx
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const LinkToEx = forwardRef<HTMLAnchorElement, LinkExProps>(({
intent,
funnel,
onClick,
to,
- 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 ThemeEnabledComponent
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ThemeEnabledComponent = () => {
const theme = useTheme()
const {
darkMode, lightMode, mode, setMode,
} = useColorSchemeEx()
Function LinkEx
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const LinkEx = forwardRef<HTMLAnchorElement, LinkExProps>(({
onClick,
disableUserEvents,
funnel,
intent,
- 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 a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const Experiments: React.FC<ExperimentsProps> = (props) => {
const {
name, children, localStorageProp = true,
} = props
const userEvents = useUserEvents()
- 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 updateCanvas
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateCanvas = (canvas: React.RefObject<HTMLCanvasElement>, props: IdenticonProps) => {
const {
value = '', size = 400, bg = 'transparent', count = 5, palette, iconPadding = 0,
} = props
let { fg } = props