Showing 1,971 of 13,422 total issues
Function StateManagedBridge
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
const StateManagedBridge = () => {
const dispatch = useAppDispatch()
const { address, isConnected, chain: connectedChain } = useAccount()
const { balances } = usePortfolioState()
const { synapseSDK } = useSynapseContext()
- 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
Method ProxySuite.TestParseRPCPayload
has 260 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *ProxySuite) TestParseRPCPayload() {
/*
CHECK BLOCKS
*/
Function DestinationAddressInput
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
export const DestinationAddressInput = ({
connectedAddress,
}: {
connectedAddress: 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 BridgeFlow
has 226 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const BridgeFlow = () => {
return (
<svg
width="100%"
viewBox="-240 0 480 164"
Method executionContext._Query
has 248 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
Object: "Query",
})
Function Home
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
export const Home = () => {
const [platform, setPlatform] = useState('ALL')
const [transactionsArr, setTransactionsArr] = useState([])
const [dailyDataArr, setDailyDataArr] = useState([])
const [kappa, setKappa] = useState('')
- 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 chain.go
has 779 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
Method executionContext._Query
has a Cognitive Complexity of 70 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
Object: "Query",
})
- 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 tokens.ts
has 523 lines of code (exceeds 250 allowed). Consider refactoring. Open
const ColorOptions = {
GRAY: 'gray',
YELLOW: 'yellow',
GREEN: 'green',
LIME: 'lime',
Method SwapParser.Parse
has 238 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *SwapParser) Parse(ctx context.Context, log ethTypes.Log, chainID uint32) (interface{}, error) {
logTopic := log.Topics[0]
iFace, err := func(log ethTypes.Log) (swapTypes.EventLog, error) {
// nolint:nestif
File getFromTokens.test.ts
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { expect } from '@jest/globals'
import { getFromTokens } from '@/utils/routeMaker/getFromTokens'
import { mockRoutes } from './__fixtures__/mockRoutes'
ILightManager
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
type ILightManager struct {
mock.Mock
}
File coins.ts
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
BUSD,
USDT,
USDC,
DAI,
Method BridgeParser.ParseLog
has a Cognitive Complexity of 69 (exceeds 20 allowed). Consider refactoring. Open
func (p *BridgeParser) ParseLog(log ethTypes.Log, chainID uint32) (*model.BridgeEvent, bridgeTypes.EventLog, error) {
logTopic := log.Topics[0]
iFace, err := func(log ethTypes.Log) (bridgeTypes.EventLog, error) {
switch logTopic {
- 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 master.ts
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Chain } from '../../types'
export const ETH: Chain = {
priorityRank: 100,
id: 1,
File index.tsx
has 505 lines of code (exceeds 250 allowed). Consider refactoring. Open
import toast from 'react-hot-toast'
import { useEffect, useRef, useState } from 'react'
import { Address, zeroAddress, isAddress } from 'viem'
import { polygon } from 'viem/chains'
import { useAccount } from 'wagmi'
Function TestToChainConfig
has 226 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestToChainConfig(t *testing.T) {
chainID := big.NewInt(1)
tests := []struct {
name string
Function TestChainGetters
has 226 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestChainGetters(t *testing.T) {
chainID := 1
badChainID := 2
usdcAddr := "0x123"
cfgWithBase := relconfig.Config{
Function APIFlow
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const APIFlow = () => {
return (
<svg
width="100%"
viewBox="-240 0 480 120"
Method ScribeSuite.TestLivefillParity
has 223 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (s *ScribeSuite) TestLivefillParity() {
if os.Getenv("CI") != "" {
s.T().Skip("Network test flake")
}
const blockRange = uint64(100)