Showing 1,971 of 13,422 total issues
Function applyBridgeSlippage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this: SynapseSDK,
bridgeModuleName: string,
originQueryInitial: Query,
destQueryInitial: Query,
slipNumerator: number = 10,
Function Col
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const Col = ({
children,
xs,
sm,
md,
- 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 txErrorHandler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const txErrorHandler = (err: any) => {
if (err?.details && checkStringForRejection(err?.details)) {
return toast.error('User denied transaction', {
id: 'toast-error-user-reject',
duration: 5000,
- 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 fetchTokenBalances
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const fetchTokenBalances = async ({
address,
chainId,
tokens,
signerOrProvider,
- 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 setOriginToken
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setOriginToken: (
state: BridgeState,
action: PayloadAction<BridgeableToken>
) => {
const incomingFromToken = action.payload
- 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 _Transaction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const _Transaction = ({
connectedAddress,
destinationAddress,
originValue,
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 LinearAnimatedProgressBar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
({
id,
startDate,
endDate,
}: {
- 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 TokenOption
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const TokenOption = ({
option,
onSelect,
selected,
parsedBalance,
- 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 LinearAnimatedProgressBar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
({
id,
startDate,
endDate,
}: {
- 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 getMaintenanceData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getMaintenanceData = () => {
const { pausedChainsData, pausedModulesData } = getSynapsePauseData()
const pausedChainsList: ChainPause[] = pausedChainsData
? pausedChainsData?.map((pause: ChainPause) => {
- 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 ListenerTestSuite.TestListenForEvents
has 6 return statements (exceeds 4 allowed). Open
func (l *ListenerTestSuite) TestListenForEvents() {
_, handle := l.manager.GetCounter(l.GetTestContext(), l.backend)
var wg sync.WaitGroup
const iterations = 10
for i := 0; i < iterations; i++ {
Function extractBinary
has 6 return statements (exceeds 4 allowed). Open
func extractBinary(_ context.Context, tarPath, destPath string) error {
// Validate paths before operations
if err := validatePath(tarPath, os.TempDir()); err != nil {
return fmt.Errorf("invalid tar file path: %w", err)
}
Method Bot.makeFastBridge
has 6 return statements (exceeds 4 allowed). Open
func (b *Bot) makeFastBridge(ctx context.Context, chainID uint32) (*fastbridge.FastBridge, error) {
client, err := rfqClient.NewUnauthenticatedClient(b.handler, b.cfg.RFQApiURL)
if err != nil {
return nil, fmt.Errorf("error creating rfq client: %w", err)
}
Function getChangedFilesFromAPI
has 6 return statements (exceeds 4 allowed). Open
func getChangedFilesFromAPI(ctx context.Context, ghContext *actionscore.Context, client *github.Client) (ct tree.Tree, err error) {
var gpe github.PullRequestEvent
// TODO: should rap into context
f, err := os.Open(os.Getenv("GITHUB_EVENT_PATH"))
if err != nil {
Method fileRateLimiter.releaseLock
has 6 return statements (exceeds 4 allowed). Open
func (f *fileRateLimiter) releaseLock() (ok bool, err error) {
f.mux.Unlock()
err = f.openFile()
if err != nil {
Function CopyModule
has 6 return statements (exceeds 4 allowed). Open
func CopyModule(toCopy, dest, packageName string) error {
// walk through the dir, see: https://github.com/markbates/pkger/blob/09e9684b656b/examples/app/main.go#L29
info, err := pkger.Info(toCopy)
if err != nil {
return fmt.Errorf("could not resolve %s", toCopy)
Function InitNotaryDB
has 6 return statements (exceeds 4 allowed). Open
func InitNotaryDB(parentCtx context.Context, database string, path string, tablePrefix string, handler metrics.Handler) (_ db.NotaryDB, err error) {
ctx, span := handler.Tracer().Start(parentCtx, "InitNotaryDB", trace.WithAttributes(
attribute.String("database", database),
attribute.String("path", path),
attribute.String("tablePrefix", tablePrefix),
Function getSearchRange
has 6 return statements (exceeds 4 allowed). Open
func getSearchRange(ctx context.Context, client ethereum.ChainReader, startHeight *big.Int) (_ *blockRange, err error) {
var output blockRange
if startHeight == nil || startHeight.Cmp(big.NewInt(0)) == 0 {
startHeight = big.NewInt(1)
}
Function downloadFile
has 6 return statements (exceeds 4 allowed). Open
func downloadFile(ctx context.Context, url string, tmpFile *os.File) error {
client := setupHTTPClient()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
Method clientImpl.checkBlacklist
has 6 return statements (exceeds 4 allowed). Open
func (c *clientImpl) checkBlacklist(ctx context.Context, address string) (bool, error) {
var resp *resty.Response
// Retry until the user is registered.
err := retry.WithBackoff(ctx,
func(ctx context.Context) (err error) {