Showing 1,971 of 13,422 total issues
Function useSwapChainListArray
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSwapChainListArray = (searchStr: string) => {
const { swapFromChainIds } = useSwapState()
let possibleChains = sortChains(
_(ALL_CHAINS)
Function getBumpTestCases
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getBumpTestCases() []*bumpTestCase {
// this will serve as a fuzz test for legacy txes
gofakeit.Seed(time.Now().UnixNano())
testCfg := gas.GetConfig()
Function createQuoteTests
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createQuoteTests = (
quoteTemplate: FastBridgeQuote,
originDecimals: number,
destDecimals: number
) => {
Function extraReducers
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
extraReducers: (builder) => {
builder
.addCase(executeBridgeTxn.pending, (state) => {
state.bridgeTxnStatus = BridgeTransactionStatus.PENDING
})
Function handleApproval
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleApproval = async (token, tokenAddr) => {
if (
inputValue[tokenAddr] &&
(inputValue[tokenAddr] === 0n ||
inputValue[tokenAddr] <= depositQuote.allowances[tokenAddr])
Function NewExecutor
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. 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 {
- 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 HarmonyProxy.getHarmonyReceiptVerify
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (r *HarmonyProxy) getHarmonyReceiptVerify(parentCtx context.Context, txHash common.Hash, rawBody []byte, checkVersion bool) (_ []byte, err error) {
ctx, span := r.tracer.Start(parentCtx, "getHarmonyReceiptVerify")
defer func() {
metrics.EndSpanWithErr(span, err)
- 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_bridgeTransactions_args
has 19 return statements (exceeds 4 allowed). Open
func (ec *executionContext) field_Query_bridgeTransactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 []*int
if tmp, ok := rawArgs["chainIDFrom"]; ok {
Method synapseCCTPHandler.FetchAndProcessSentEvent
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (s *synapseCCTPHandler) FetchAndProcessSentEvent(parentCtx context.Context, txhash common.Hash, originChain uint32) (msg *relayTypes.Message, err error) {
ctx, span := s.handler.Tracer().Start(parentCtx, "FetchAndProcessSentEvent", trace.WithAttributes(
attribute.String(metrics.TxHash, txhash.String()),
attribute.Int(metrics.ChainID, int(originChain)),
))
- 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 formatAmount
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const formatAmount = (
amount: string,
options?: FormatOptions
): string => {
if (amount === '') {
- 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 commify
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const commify = (value: string | number): string => {
const comps = String(value).split('.')
if (
comps.length > 2 ||
- 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 formatAmount
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const formatAmount = (
amount: string,
options?: FormatOptions
): string => {
if (amount === '') return ''
- 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 useBridgeTxStatus
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const useBridgeTxStatus = ({
synapseSDK,
originChainId,
destinationChainId,
originTxHash,
- 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 TokenSelect
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const TokenSelect = ({ label, isOrigin, token, onChange }: Props) => {
const {
originChainId,
destinationChainId,
originTokens,
- 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 TestBaseMessageEncodeParity
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestBaseMessageEncodeParity(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
testBackend := simulated.NewSimulatedBackend(ctx, t)
Method Manager.generateQuotes
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (m *Manager) generateQuotes(parentCtx context.Context, chainID int, address common.Address, balance *big.Int, inv map[int]map[common.Address]*big.Int) (quotes []model.PutRelayerQuoteRequest, err error) {
ctx, span := m.metricsHandler.Tracer().Start(parentCtx, "generateQuotes", trace.WithAttributes(
attribute.Int(metrics.Origin, chainID),
attribute.String("address", address.String()),
attribute.String("balance", balance.String()),
Method queryResolver.AmountStatistic
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r *queryResolver) AmountStatistic(ctx context.Context, typeArg model.StatisticType, duration *model.Duration, platform *model.Platform, chainID *int, address *string, tokenAddress *string, useCache *bool, useMv *bool) (*model.ValueResult, error) {
if useCache != nil && *useCache {
res, err := r.getValueResultFromCache(fmt.Sprintf("amountStatistic, %s, %s, %s, %s, %s, %s", typeArg.String(), platform.String(), duration.String(), keyGenHandleNilInt(chainID), keyGenHandleNilString(address), keyGenHandleNilString(tokenAddress)))
if err == nil {
return res, nil
Function getBridgeRoutes
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async getBridgeRoutes(
originChainId: number,
destChainId: number,
tokenIn: string,
tokenOut: string,
Function UseCasesSection
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function UseCasesSection() {
const t = useTranslations('Landing.UseCasesSection')
const useCases: UseCaseProp[] = [
{
Function MultiChainGamingIcon
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MultiChainGamingIcon() {
return (
<svg
width="335"
height="196"