Showing 124 of 486 total issues
Function usePollingFunction
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
export const usePollingFunction = <T extends Payload = Payload>(
config?: IndexedResultsConfig,
pollDivinerConfig: PollingConfig = DEFAULT_POLLING_CONFIG,
functionToPoll?: FunctionToPoll,
onResult?: (result: T[] | null) => void,
- 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 createPollingFunction
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
export const createPollingFunction = <T extends Payload = Payload>(
config?: IndexedResultsConfig,
pollDivinerConfig: PollingConfig = DEFAULT_POLLING_CONFIG,
pollingFunction?: PollingFunction,
onResult?: (result: T[] | null) => void,
- 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 ButtonSection
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const ButtonSection: React.FC<ButtonSectionProps> = ({
href, to, buttonText,
}) => {
const isMobile = useIsSmall()
return href
- 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 useBoundWitnessClickHandler
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const useBoundWitnessClickHandler = () => {
const mounted = useMounted()
const {
hashSelectionHistory, fetchFromHash, addSelection, clearHistory,
} = usePayloadHashSelectionHistory(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 LayerAnimator
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const LayerAnimator: React.FC<WithChildren<LayerAnimatorProps>> = ({
animateLayers, children, layers, layersInitialized, map,
}) => {
const layerIndexQueue = useRef<number[]>([])
- 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 useTryDiviners
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const useTryDiviners = <T extends Payload = Payload>(config?: IndexedResultsConfig): (() => Promise<Payload[] | undefined | null>) => {
const [node] = useProvidedNode()
const { indexedQueries, processIndexedResults } = config ?? {}
const parseIndexedResults = processIndexedResults?.parseIndexedResults
- 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 PayloadDynamicTableRow
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const PayloadDynamicTableRow: React.FC<PayloadDynamicTableRowProps> = ({
archive,
columns,
exploreDomain,
network: networkProp,
- 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 payloadDynamicTableColumnConfigDefaults
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const payloadDynamicTableColumnConfigDefaults = (): PayloadDynamicTableColumnConfig => {
const xs: PayloadDynamicTableColumnHeadData[] = [
{
alignment: 'left', name: 'Hash', slug: 'hash', width: '100%',
},
Function usePollingFunction
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const usePollingFunction = <T extends Payload = Payload>(
config?: IndexedResultsConfig,
pollDivinerConfig: PollingConfig = DEFAULT_POLLING_CONFIG,
functionToPoll?: FunctionToPoll,
onResult?: (result: T[] | null) => void,
Function initializeAnimatedHeatMapSource
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async initializeAnimatedHeatMapSource(
layers: MapLayer[],
featureSet: Feature<Polygon>[][],
map: Map,
startColor?: string,
Function TestSentinel
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const TestSentinel: React.FC<TestSentinelProps> = ({ children }) => {
const [node] = useNode()
const [addressField, setAddressField] = useState(address)
const [tokenInterfaceField, setTokenInterfaceField] = useState(supportedTokenInterfaces[0])
const [valid, setValid] = useState<boolean>()
- 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 SimpleCard
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const SimpleCard: React.FC<SimpleCardProps> = ({
desc,
iconImage,
interactionVariant = 'card',
headline,
- 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 initializeAnimatedHeatMapSource
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
static async initializeAnimatedHeatMapSource(
layers: MapLayer[],
featureSet: Feature<Polygon>[][],
map: Map,
startColor?: string,
- 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 PayloadTableRow
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const PayloadTableRow: React.FC<PayloadTableRowProps> = ({
archive,
columns,
exploreDomain,
maxSchemaDepth,
- 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 createPollingFunction
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createPollingFunction = <T extends Payload = Payload>(
config?: IndexedResultsConfig,
pollDivinerConfig: PollingConfig = DEFAULT_POLLING_CONFIG,
pollingFunction?: PollingFunction,
onResult?: (result: T[] | null) => void,
Function BasicHero
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const BasicHero: React.FC<BasicHeroProps> = ({
backgroundImage,
title,
gradientTitle,
backgroundColor,
- 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 orderedHistory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const orderedHistory = async (addressHistory?: BoundWitness[], order: 'asc' | 'desc' = 'asc') => {
if (addressHistory?.length) {
const stack: BoundWitness[] = []
const youngestBW = await findYoungestBW(addressHistory)
const hashes = await PayloadHasher.hashes(addressHistory)
- 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 EmbedCardHeader
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
const { refreshHuri, huri } = useResolvePayload()
const {
activePlugin, timestampLabel, hideElementsConfig,
} = useEmbedPluginState()
- 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 HashSelectionHistoryProvider
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const HashSelectionHistoryProvider: React.FC<HashSelectionHistoryProviderProps> = ({
archivist,
children,
defaultHashSelectionHistory,
defaultNestedBoundWitnesses,
- 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 usePromise
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const usePromise = <TResult>(
promise: () => Promise<TResult | undefined>,
dependencies: DependencyList,
debug: string | undefined = undefined,
): [TResult | undefined, Error | undefined, State | undefined] => {