Showing 1,971 of 13,422 total issues
Function GetDeployments
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetDeployments(deploymentDir string) (contracts []Contract, err error) {
var files []os.DirEntry
files, err = os.ReadDir(deploymentDir)
if err != nil {
Method chainListener.doPoll
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *chainListener) doPoll(parentCtx context.Context, handler HandleLog) (err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "doPoll", trace.WithAttributes(attribute.Int(metrics.ChainID, int(c.chainID))))
c.pollInterval = c.pollIntervalSetting
// Note: in the case of an error, you don't have to handle the poll interval by calling b.duration.
Method Oracle.SuggestPrice
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
head, _ := gpo.backend.HeaderByNumber(ctx, rpc.LatestBlockNumber)
headHash := head.Hash()
// If the latest gasprice is still available, return it.
Function TestPendingAndCallContract
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestPendingAndCallContract(t *testing.T) {
t.Parallel()
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()
Method DBSuite.TestGetRelayableAgentStatuses
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *DBSuite) TestGetRelayableAgentStatuses() {
// Test by setting up multiple addresses and agent roots in the database. Then, once each agent tree is stored with
// the agent root and address, get the agent trees that match up with a specific chain ID.
t.RunOnAllDBs(func(testDB db.GuardDB) {
addressA := common.BigToAddress(big.NewInt(gofakeit.Int64()))
Method circleCCTPHandler.handleDepositForBurn
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *circleCCTPHandler) handleDepositForBurn(parentCtx context.Context, log *types.Log, chainID uint32) (msg *relayTypes.Message, err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "handleDepositForBurn", trace.WithAttributes(
attribute.String(metrics.TxHash, log.TxHash.Hex()),
attribute.Int(metrics.ChainID, int(chainID)),
attribute.Int("block_number", int(log.BlockNumber)),
Function conflictingProofsController
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const conflictingProofsController = async (
req: Request,
res: Response
) => {
try {
Function createSlippageTests
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createSlippageTests = (
moduleSet: SynapseModuleSet,
originQuery: Query,
destQuery: Query,
expectedOriginMinAmountOut: BigNumber,
Function PageFooter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function PageFooter() {
const t = useTranslations('Nav')
return (
<footer>
<div className="flex flex-wrap justify-between max-w-4xl gap-8 p-8 m-auto">
Function handleDeposit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleDeposit = async () => {
setIsDepositing(true)
const currentTimestamp: number = getUnixTimeMinutesFromNow(0)
try {
const txReceipt = await deposit(amount)
Function balancePromises
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const balancePromises = filteredChains.map(async (chainId) => {
const currentChainId = Number(chainId)
return (async () => {
try {
Method baseChain.HeaderByTime
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (b *baseChain) HeaderByTime(ctx context.Context, startHeight *big.Int, targetTime time.Time) (*types.Header, error) {
// grab the MeteredEVMClient explicitly to avoid ambiguous references
client, err := newHeaderCacheClient(b, 4)
if err != nil {
return nil, fmt.Errorf("could not create header cache client: %w", 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
Function NewAnvilBackend
has 15 return statements (exceeds 4 allowed). Open
func NewAnvilBackend(ctx context.Context, t *testing.T, args *OptionBuilder) (*Backend, error) {
t.Helper()
pool, err := dockertest.NewPool("")
if err != nil {
Method Guard.updateAgentStatus
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (g Guard) updateAgentStatus(ctx context.Context, chainID uint32) error {
eligibleAgentTrees, err := g.guardDB.GetRelayableAgentStatuses(ctx, chainID)
if err != nil {
return fmt.Errorf("could not get update agent status parameters: %w", 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 Guard.handleReceiptAccepted
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (g Guard) handleReceiptAccepted(ctx context.Context, log ethTypes.Log) error {
fraudReceipt, err := g.inboxParser.ParseReceiptAccepted(log)
if err != nil {
return fmt.Errorf("could not parse receipt accepted: %w", 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_messageBusTransactions_args
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_messageBusTransactions_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["chainID"]; ok {
- 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_transactionsAtHeadRange_args
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_transactionsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["tx_hash"]; ok {
- 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_logs_args
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_logs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
- 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_logs_args
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_logs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
- 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_transactionsAtHeadRange_args
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_transactionsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["tx_hash"]; ok {
- 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"