Showing 1,971 of 13,422 total issues
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.pickBy((values, _key) => values.some((v) => v.endsWith(`-${toChainId}`)))
.pickBy((_values, key) => key.endsWith(`-${fromChainId}`))
.keys()
.uniq()
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.pickBy((values, _key) => {
return _.includes(values, `${toTokenRouteSymbol}-${toChainId}`)
})
.keys()
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.entries()
.filter(([key, _values]) => key.startsWith(`${fromTokenRouteSymbol}-`))
.map(([key, _values]) => key)
.flatten()
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.entries()
.filter(([key, _values]) => key.startsWith(`${fromTokenRouteSymbol}-`))
.map(([_key, values]) => values)
.flatten()
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.values()
.flatten()
.map((token) => getTokenAndChainId(token).chainId)
.uniq()
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.mapValues((values) =>
values.filter((token) => token.startsWith(`${toTokenRouteSymbol}`))
)
.values()
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return <div className="text-sm">{estTime}</div>
Avoid too many return
statements within this function. Open
return toast.error(err?.message, {
id: 'toast-error',
duration: 5000,
})
Avoid too many return
statements within this function. Open
return (
<Tooltip
hoverText="Amount may not exceed available balance"
positionStyles={tooltipPositionStyle}
>
Avoid too many return
statements within this function. Open
return (
<div data-test-id="bridge-button">
{isApproved ? (
<button
disabled={isBridgePending}
Avoid too many return
statements within this function. Open
return (
<Tooltip
hoverText="Enter valid amount"
positionStyles={tooltipPositionStyle}
>
Avoid too many return
statements within this function. Open
return (
<button className={buttonClassName} style={buttonStyle} disabled>
Send
</button>
)
Method Backend.WaitForConfirmation
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (b *Backend) WaitForConfirmation(parentCtx context.Context, transaction *types.Transaction) {
ctx, cancel := onecontext.Merge(b.ctx, parentCtx)
defer cancel()
//nolint: contextcheck
- 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 UtilSuite.TestCopyTX
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (u *UtilSuite) TestCopyTX() {
mockDynamicTXS := mocks.GetMockTxes(u.GetTestContext(), u.T(), 100, types.DynamicFeeTxType)
mockLegacyTXes := mocks.GetMockTxes(u.GetTestContext(), u.T(), 100, types.LegacyTxType)
// delete me
- 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 TXSubmitterDBSuite.TestGetTransactionsWithLimitPerChainID
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (t *TXSubmitterDBSuite) TestGetTransactionsWithLimitPerChainID() {
t.RunOnAllDBs(func(testDB db.Service) {
for _, backend := range t.testBackends {
manager := t.managers[backend.GetChainID()]
- 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 Backend.getTransactionLabelMap
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (b *Backend) getTransactionLabelMap(tx *types.Transaction, from common.Address) (res map[common.Address]string) {
b.verifiedMux.RLock()
defer b.verifiedMux.RUnlock()
res = map[common.Address]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
Method Manager.generateQuotes
has a Cognitive Complexity of 21 (exceeds 20 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()),
- 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 QuoteRequestHandler.handleProofPosted
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (q *QuoteRequestHandler) handleProofPosted(ctx context.Context, span trace.Span, request reldb.QuoteRequest) (err error) {
// we shouldnt' check the claim yet
if !q.shouldCheckClaim(request) {
return 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
Function GetPartialInfoFromBridgeEventHybrid
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func GetPartialInfoFromBridgeEventHybrid(bridgeEvent sql.HybridBridgeEvent, includePending *bool) (*model.BridgeTransaction, error) {
if includePending != nil && *includePending && bridgeEvent.TTxHash != "" {
// nolint:nilnil
return nil, 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"