Showing 1,971 of 13,422 total issues
Function useEthereumWallet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useEthereumWallet = () => {
const [connectedAddress, setConnectedAddress] = useState<string>('')
const [web3Provider, setWeb3Provider] = useState<any>(null)
const [connectedNetwork, setConnectedNetwork] = useState<Network | null>()
Function useEthereumWallet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useEthereumWallet = () => {
const [connectedAddress, setConnectedAddress] = useState<string>('')
const [web3Provider, setWeb3Provider] = useState<any>(null)
const [connectedNetwork, setConnectedNetwork] = useState<Network | null>()
Function ResourcesSection
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ResourcesSection() {
const t = useTranslations('Landing.ResourcesSection')
return (
<SectionContainer
dataTestId="landing-resources-section"
Function useMaintenance
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useMaintenance = () => {
const { originChainId, destinationChainId } = useBridgeState()
const { pausedChainsList, pausedModulesList } = getMaintenanceData()
const activePause = pausedChainsList.find(
Method queryResolver.AddressData
has 14 return statements (exceeds 4 allowed). Open
Open
func (r *queryResolver) AddressData(ctx context.Context, address string) (*model.AddressData, error) {
bridgeQuery := fmt.Sprintf("SELECT toFloat64(sumKahan(famount_usd)) AS volumeTotal, toFloat64(sumKahan(tfee_amount_usd)) AS feeTotal, toInt64(uniq(fchain_id, ftx_hash)) AS txTotal FROM (SELECT * FROM mv_bridge_events where fsender = '%s' LIMIT 1 BY fchain_id,fcontract_address, fevent_type, fblock_number, fevent_index, ftx_hash)", address)
swapQuery := fmt.Sprintf("SELECT toFloat64(sumKahan(multiIf(event_type = 0, amount_usd[sold_id], event_type = 1, arraySum(mapValues(amount_usd)), event_type = 9, arraySum(mapValues(amount_usd)), event_type = 10, amount_usd[sold_id],0))) AS volumeTotal, toFloat64(sumKahan(arraySum(mapValues(fee_usd)))) AS feeTotal, toInt64(uniq(chain_id, tx_hash)) AS txTotal FROM (SELECT * FROM swap_events where sender = '%s' LIMIT 1 BY chain_id, contract_address, event_type, block_number, event_index, tx_hash)", address)
rankingQuery := fmt.Sprintf("select rowNumber from (select sender, row_number() over (order by sumTotal desc ) as rowNumber from (select fsender as sender, sumKahan(famount_usd) as sumTotal from (SELECT * FROM mv_bridge_events where fsender != '' LIMIT 1 BY fchain_id, fcontract_address, fevent_type, fblock_number, fevent_index, ftx_hash) where fsender != '' group by fsender)) where sender = '%s'", address)
firstTx := fmt.Sprintf("SELECT min(ftimestamp) AS earliestTime FROM (SELECT * FROM mv_bridge_events where fsender = '%s' LIMIT 1 BY fchain_id,fcontract_address, fevent_type, fblock_number, fevent_index, ftx_hash)", address)
Method MessageBusParser.Parse
has 14 return statements (exceeds 4 allowed). Open
Open
func (m *MessageBusParser) Parse(ctx context.Context, log ethTypes.Log, chainID uint32) (interface{}, error) {
logTopic := log.Topics[0]
iFace, err := func(log ethTypes.Log) (messageBusTypes.EventLog, error) {
switch logTopic {
case messagebus.Topic(messageBusTypes.ExecutedEvent):
Method Indexer.store
has 14 return statements (exceeds 4 allowed). 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)),
Consider simplifying this complex logical expression. Open
Open
if (
originChainSelect &&
destinationChainSelect &&
originTokenSelect &&
destinationTokenSelect
Method Bot.rfqLookupCommand
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (b *Bot) rfqLookupCommand() *slacker.CommandDefinition {
return &slacker.CommandDefinition{
Command: "rfq <tx>",
Description: "find a rfq transaction by either tx hash or txid from the rfq-indexer api",
Examples: []string{
Method Notary.shouldNotaryRegisteredOnDestination
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (n *Notary) shouldNotaryRegisteredOnDestination(parentCtx context.Context) (bool, bool) {
ctx, span := n.handler.Tracer().Start(parentCtx, "shouldNotaryRegisteredOnDestination", trace.WithAttributes(
attribute.Int(metrics.ChainID, int(n.destinationDomain.Config().DomainID)),
))
defer span.End()
Method rebalanceManagerCircleCCTP.Execute
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *rebalanceManagerCircleCCTP) Execute(parentCtx context.Context, rebalance *RebalanceData) (err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "rebalance.Execute", trace.WithAttributes(
attribute.Int("rebalance_origin", rebalance.OriginMetadata.ChainID),
attribute.Int("rebalance_dest", rebalance.DestMetadata.ChainID),
attribute.String("rebalance_amount", rebalance.Amount.String()),
Method BackfillSuite.redeemAndRemoveParity
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (b *BackfillSuite) redeemAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenRedeemAndRemove(*log)
if err != nil {
Method APISuite.TestRetrieveData
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (g APISuite) TestRetrieveData() {
contractAddressA := common.BigToAddress(big.NewInt(gofakeit.Int64()))
contractAddressB := common.BigToAddress(big.NewInt(gofakeit.Int64()))
chainID := uint32(1)
Function pendingTransactionsMissingClaimController
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const pendingTransactionsMissingClaimController = async (
req: Request,
res: Response
) => {
try {
Function useTransactionListener
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useTransactionListener = () => {
const dispatch = useAppDispatch()
const {
txHash,
originAmount,
Function TokenAndChainCustomization
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TokenAndChainCustomization = () => {
return (
<>
<p>
While the Synapse Widget supports <a href="https://synapseprotocol.com" target="_blank" rel="noreferrer">hundreds of tokens and chains</a>, you can instruct the Bridge to prioritize routes to your project for a streamlined experience.
Function getMaintenanceData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMaintenanceData = () => {
const { pausedChainsData, pausedModulesData } = getSynapsePauseData()
const pausedChainsList: ChainPause[] = pausedChainsData
? pausedChainsData?.map((pause: ChainPause) => {
Function compileSolidity
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func compileSolidity(version string, filePath string, optimizeRuns int, evmVersion *string) (map[string]*compiler.Contract, error) {
runFile, err := createRunFile(version)
if err != nil {
return nil, err
}
Method DBSuite.TestGetPotentialSnapshotRoots
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (t *DBSuite) TestGetPotentialSnapshotRoots() {
t.RunOnAllDBs(func(testDB db.ExecutorDB) {
origin := gofakeit.Uint32()
nonceA := uint32(5)
nonceB := uint32(10)
Method Manager.prepareAndSubmitQuotes
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (m *Manager) prepareAndSubmitQuotes(ctx context.Context, inv map[int]map[common.Address]*big.Int) (err error) {
ctx, span := m.metricsHandler.Tracer().Start(ctx, "prepareAndSubmitQuotes")
defer func() {
span.SetAttributes(attribute.Bool("relay_paused", m.relayPaused.Load()))
metrics.EndSpanWithErr(span, err)