Showing 1,971 of 13,422 total issues
Avoid deeply nested control flow statements. Open
goto DumpRes
Avoid deeply nested control flow statements. Open
goto End
Method EventDB.StoreEthTxAtHead
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func (_m *EventDB) StoreEthTxAtHead(ctx context.Context, tx *types.Transaction, chainID uint32, blockHash common.Hash, blockNumber uint64, transactionIndex uint64) error {
Method Client.GetReceiptsAtHeadRange
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func (c *Client) GetReceiptsAtHeadRange(ctx context.Context, chainID int, startBlock int, endBlock int, page int, httpRequestOptions ...client.HTTPRequestOption) (*GetReceiptsAtHeadRange, error) {
Method Store.StoreEthTx
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s Store) StoreEthTx(ctx context.Context, tx *types.Transaction, chainID uint32, blockHash common.Hash, blockNumber uint64, transactionIndex uint64) error {
Method Store.StoreEthTxAtHead
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s Store) StoreEthTxAtHead(ctx context.Context, tx *types.Transaction, chainID uint32, blockHash common.Hash, blockNumber uint64, transactionIndex uint64) error {
Method Store.RetrieveUnconfirmedEthTxsFromHeadRangeQuery
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s Store) RetrieveUnconfirmedEthTxsFromHeadRangeQuery(ctx context.Context, ethTxFilter db.EthTxFilter, startBlock uint64, endBlock uint64, lastIndexed uint64, page int) ([]db.TxWithBlockNumber, error) {
Avoid deeply nested control flow statements. Open
goto DumpRes
Function formatBigIntToString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const formatBigIntToString = (
bi: bigint,
nativePrecision: number,
decimalPlaces?: number
) => {
- 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 formatBigIntToString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const formatBigIntToString = (
bi: bigint,
nativePrecision: number,
decimalPlaces?: number
) => {
- 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 captureTransport.RoundTrip
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
func (t *captureTransport) RoundTrip(req *http.Request) (_ *http.Response, err error) {
var response string
_, span := t.metrics.Tracer().Start(req.Context(), RequestSpanName)
defer func() {
- 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
Avoid deeply nested control flow statements. Open
with open(file_path, 'r') as json_file:
data = json.load(json_file)
address = data.get('address', 'Address not found')
print(f"{file.replace('.json', '')}: {address}")
print() # Print a newline for better separation
Avoid deeply nested control flow statements. Open
for (const tokenB in swappableMap[chainB]) {
const symbolB = swappableMap[chainB][tokenB].symbol
const value = `${symbolB}-${chainB}`
if (exclusionList.includes(value)) continue
Function swap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this: SynapseSDK,
chainId: number,
to: string,
token: string,
amount: BigintIsh,
Function fetchJsonData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const fetchJsonData = async (url: string): Promise<any> => {
// Configurable parameters
const maxRetries = 3 // maximum number of retries
const initialDelay = 1000 // initial delay in milliseconds
- 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
Avoid deeply nested control flow statements. Open
for (const tokenB in swappableMap[chainB]) {
const symbolB = swappableMap[chainB][tokenB].symbol
const value = `${symbolB}-${chainB}`
if (exclusionList.includes(value)) continue
Function swapQuote
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this: SynapseSDK,
chainId: number,
tokenIn: string,
tokenOut: string,
amountIn: BigintIsh,
Function destinationAddressMiddleware
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
(_store) => (next) => async (action) => {
if (setDestinationAddress.match(action) && action.payload !== null) {
const isRisky = await screenAddress(action.payload)
if (isRisky) {
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 applyBridgeDeadline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this: SynapseSDK,
bridgeModuleName: string,
originQueryInitial: Query,
destQueryInitial: Query,
originDeadline?: BigNumber,
Avoid deeply nested control flow statements. Open
for (const tokenB in swappableMap[chainB]) {
const symbolB = swappableMap[chainB][tokenB].symbol
const value = `${symbolB}-${chainB}`
if (exclusionList.includes(value)) {