Showing 17 of 19 total issues
File sut.ts
has 639 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
InitializerArgs,
InitialStep,
StepData,
StepperState,
Function Select
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const Select = ({
placeholder,
size = 'medium',
disabled = false,
hasError = 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 Faucet
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const Faucet: React.FC<FaucetProps> = ({ chainId, captcha }: DeepReadonly<FaucetProps>) => {
const [initiator, setInitiator]: UseState<Initiator> = useState<Initiator>(null)
const [walletRecaptcha, setWalletRecaptcha]: UseState<boolean> = useState<boolean>(false)
const [addressRecaptcha, setAddressRecaptcha]: UseState<boolean> = useState<boolean>(false)
const faucetDispatch = useFaucetDispatch()
- 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 stepperReducer
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const stepperReducer = (
state: DeepReadonly<StepperState>,
action: DeepReadonly<StepperAction>
): DeepReadonly<StepperState> => {
switch (action.type) {
- 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
File Faucet.tsx
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useCallback, useMemo, useState } from 'react'
import keplrImage from 'assets/images/keplr.png'
import { acknowledgeError } from 'domain/error/usecase/acknowledge-error/acknowledgeError'
import type { AppState as FaucetAppState } from 'domain/faucet/store/appState'
import type { AppState as TaskAppState } from 'domain/task/store/appState'
Function Stepper
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const Stepper: React.FC<StepperProps> = ({
steps,
activeStepId,
isSubmitDisabled,
submitButtonLabel,
- 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 registerTask
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
(registerTaskPayload: DeepReadonly<RegisterTask>): ThunkResult<Promise<void>> =>
// eslint-disable-next-line @typescript-eslint/typedef
async (dispatch, getState) => {
const {
id,
- 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 uploadFiles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
(uploadFilesPayload: DeepReadonly<UploadFiles>): ThunkResult<Promise<void>> =>
// eslint-disable-next-line @typescript-eslint/typedef
async (dispatch, getState, { fileRegistryGateway }) => {
try {
const storeParams: StoreParams = { state: getState(), dispatch }
- 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 isProgressValid
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const isProgressValid = (progress: DeepReadonly<Progress>): boolean => {
const { max, min, current }: Progress = progress
// force undefined explicit assertion to ensure that 0 and negative values are excluded
if (current !== 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 drawBouncingText
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const drawBouncingText = ({
canvas,
deltaCount
}: {
canvas: HTMLCanvasElement
- 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
Consider simplifying this complex logical expression. Open
if (useInit()) {
const { scene }: WorldTickData = world.latestTickData
const camera = new ArcRotateCamera(
options?.name ?? defaultArcRotateCamera.name,
options?.alpha ?? defaultArcRotateCamera.alpha,
Function configureTaskProgressBounds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(
configureTaskProgressBoundsPayload: DeepReadonly<ConfigureTaskProgressBounds>
): ThunkResult<Promise<void>> =>
// eslint-disable-next-line @typescript-eslint/typedef
async (dispatch, getState) => {
- 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 FileInput
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const FileInput: React.FC<FileInputProps> = ({
label,
description,
multiple = true,
acceptedFormats,
- 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 {
...state,
steps: state.steps.set(activeId, { ...activeStep, status: 'completed' })
}
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
return {
...state,
...(payloadIsOk && {
steps: state.steps
.map((step: DeepReadonly<StepData>) => ({
Avoid too many return
statements within this function. Open
if (min !== undefined && max !== undefined) return min < max