Showing 1,971 of 13,422 total issues
Function _applySlippage
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
export const _applySlippage = (
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
Method executionContext.field_Query_logsAtHeadRange_args
has 102 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (ec *executionContext) field_Query_logsAtHeadRange_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 {
Method executionContext.field_Query_logsAtHeadRange_args
has 102 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (ec *executionContext) field_Query_logsAtHeadRange_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 {
File docs.go
has 544 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
Function executeSearch
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const executeSearch = (searchPage?: number, searchTxOrKappaHash?: string) => {
const queryPage = searchPage ?? page
const queryKappa = searchTxOrKappaHash ?? kappa
if (queryKappa && queryKappa !== '' && queryKappa.length < 64) {
alert('Invalid hash entered')
File fastBridgeRouter.test.ts
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { mock } from 'jest-mock-extended'
import { BigNumber, providers } from 'ethers'
import { Log, TransactionReceipt } from '@ethersproject/abstract-provider'
import { FastBridgeRouter } from './fastBridgeRouter'
AnvilSuite
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (a *AnvilSuite) TestClientImpersonateAccount() {
ogCount, err := a.counter.GetVitalikCount(&bind.CallOpts{Context: a.GetTestContext()})
Nil(a.T(), err)
err = a.client.ImpersonateAccount(a.GetTestContext(), vitalik)
Method Executor.Execute
has 100 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (e Executor) Execute(parentCtx context.Context, message types.Message) (_ bool, err error) {
originDomain := message.OriginDomain()
destinationDomain := message.DestinationDomain()
ctx, span := e.handler.Tracer().Start(parentCtx, "Execute", trace.WithAttributes(
Method APISuite.TestAmountStatistic
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (g APISuite) TestAmountStatistic() {
chainID := g.chainIDs[0]
destinationChainIDA := g.chainIDs[1]
destinationChainIDB := g.chainIDs[2]
address := common.BigToAddress(big.NewInt(gofakeit.Int64()))
Function setSwapChainId
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setSwapChainId: (state, action: PayloadAction<number>) => {
const incomingFromChainId = action.payload
const validFromTokens = _(
getSwapFromTokens({
File event_db.go
has 539 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
File query.test.ts
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { BigNumber } from '@ethersproject/bignumber'
import {
RouterQuery,
CCTPRouterQuery,
File NerveLogoSvg.tsx
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export const NerveLogoSvg = ({ className = '' }) => {
return (
<svg
className={`w-8 ${className}`}
fillRule="nonzero"
Function NewExecutor
has 98 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func NewExecutor(ctx context.Context, config executor.Config, executorDB db.ExecutorDB, scribeClient client.ScribeClient, omniRPCClient omnirpcClient.RPCClient, handler metrics.Handler) (*Executor, error) {
chainExecutors := make(map[uint32]*chainExecutor)
conn, grpcClient, err := makeScribeClient(ctx, handler, fmt.Sprintf("%s:%d", scribeClient.URL, scribeClient.Port))
if err != nil {
Method GuardSuite.TestFraudulentAttestationOnDestination
has 98 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (g *GuardSuite) TestFraudulentAttestationOnDestination() {
testDone := false
defer func() {
testDone = true
}()
Method GuardSuite.TestReportFraudulentStateInAttestation
has 98 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (g *GuardSuite) TestReportFraudulentStateInAttestation() {
testDone := false
defer func() {
testDone = true
}()
Function createParsers
has 98 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func createParsers(ctx context.Context, db db.ConsumerDB, fetcher fetcherpkg.ScribeFetcher, clients map[uint32]etherClient.EVM, config serverConfig.Config) (*types.ServerParsers, *types.ServerRefs, map[string]*swap.SwapFlashLoanFilterer, error) {
ethClient, err := ethclient.DialContext(ctx, config.RPCURL+fmt.Sprintf("%d", 1))
if err != nil {
return nil, nil, nil, fmt.Errorf("could not create client: %w", err)
}
Method Indexer.store
has 98 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (x *Indexer) store(parentCtx context.Context, log types.Log) (err error) {
ctx, span := x.handler.Tracer().Start(parentCtx, "store", trace.WithAttributes(
attribute.String("contract", x.addressesToString(x.indexerConfig.Addresses)),
attribute.String("tx", log.TxHash.Hex()),
attribute.String("block", fmt.Sprintf("%d", log.BlockNumber)),
Function LandingNav
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function LandingNav() {
const t = useTranslations('Nav')
return (
<Popover>
Function PoolsPage
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PoolsPage = () => {
const { address: currentAddress } = useAccount()
const { chain } = useAccount()
const [connectedChainId, setConnectedChainId] = useState(0)
const [address, setAddress] = useState(undefined)