Showing 1,971 of 13,422 total issues
Function TestCallContractRevert
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func TestCallContractRevert(t *testing.T) {
t.Parallel()
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()
- 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 executionContext.field_Query_logsRange_args
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_logsRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
- 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 executionContext.field_Query_logsRange_args
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_logsRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
- 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 useGasEstimator
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const useGasEstimator = () => {
const dispatch = useAppDispatch()
const { address } = useAccount()
const { synapseSDK } = useSynapseContext()
const { balances } = usePortfolioState()
- 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 _applySlippageBigInt
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const _applySlippageBigInt = (
inputValue,
slippageSelected,
slippageCustom,
add = 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 TransactionPayloadDetail
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const TransactionPayloadDetail = ({
chain,
token,
tokenAmount,
isOrigin,
- 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 InputContainer
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const InputContainer: React.FC<InputContainerProps> = ({
setIsTyping,
}) => {
const dispatch = useAppDispatch()
const { chain, isConnected } = useAccount()
- 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 [kappa].tsx
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
import { TRANSACTIONS_PATH, ACCOUNTS_PATH } from '@urls'
import { ChainInfo } from '@components/misc/ChainInfo'
import { Error } from '@components/Error'
import { StandardPageContainer } from '@components/layouts/StandardPageContainer'
Function TestEstimateGas
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestEstimateGas(t *testing.T) {
t.Parallel()
/*
pragma solidity ^0.6.4;
contract GasEstimation {
Method APISuite.TestGetCountByTokenAddress
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g APISuite) TestGetCountByTokenAddress() {
chainID := g.chainIDs[0]
destinationChainID := g.chainIDs[1]
tokenAddressA := common.BigToAddress(big.NewInt(gofakeit.Int64()))
tokenAddressB := common.BigToAddress(big.NewInt(gofakeit.Int64()))
Method APISuite.SetupTest
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g *APISuite) SetupTest() {
g.TestSuite.SetupTest()
initialFallback := graph.GetFallbackTime()
graph.UnsafeSetFallbackTime(time.Second * 20)
Function getAndSetBridgeQuote
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getAndSetBridgeQuote = async () => {
currentSDKRequestID.current += 1
const thisRequestId = currentSDKRequestID.current
// will have to handle deadlineMinutes here at later time, gets passed as optional last arg in .bridgeQuote()
File notary.go
has 535 lines of code (exceeds 500 allowed). Consider refactoring. Open
package notary
import (
"context"
"fmt"
Method NodeSuite.TestLive
has 96 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c NodeSuite) TestLive() {
if os.Getenv("CI") != "" {
c.T().Skip("Network / processing test flake")
}
chainConfigs := []indexerConfig.ChainConfig{}
Function getCountdownTimeStatus
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getCountdownTimeStatus = (
startDate: Date | null,
endDate: Date | null
) => {
if (!startDate && !endDate) {
Function setOriginToken
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOriginToken: (
state: BridgeState,
action: PayloadAction<BridgeableToken>
) => {
const incomingFromToken = action.payload
Function setDestinationToken
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
setDestinationToken: (
state: BridgeState,
action: PayloadAction<BridgeableToken>
) => {
const incomingToToken = action.payload
Function getCountdownTimeStatus
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getCountdownTimeStatus = (
startDate: Date,
endDate: Date | null
) => {
if (!startDate && !endDate) {
Function fetchPortfolioBalances
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const fetchPortfolioBalances = async (
address: string,
chainId?: number | undefined | null
): Promise<{
balances: NetworkTokenBalances
Method BridgeParser.ParseLog
has 32 return statements (exceeds 4 allowed). 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 {