Showing 1,971 of 13,422 total issues
Method executionContext.field_Query_receiptsAtHeadRange_args
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_receiptsAtHeadRange_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["chain_id"]; 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_receiptsRange_args
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_receiptsRange_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["chain_id"]; 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_receiptsRange_args
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_receiptsRange_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["chain_id"]; 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_receiptsAtHeadRange_args
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_receiptsAtHeadRange_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["chain_id"]; 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
Function fetchBridgeQuote
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
async (
{
synapseSDK,
fromChainId,
toChainId,
- 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 UniversalSearch
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const UniversalSearch = ({
setPending,
pending,
loading,
setWallet,
- 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 DBSuite.TestGetTimestampForMessage
has 72 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *DBSuite) TestGetTimestampForMessage() {
t.RunOnAllDBs(func(testDB db.ExecutorDB) {
origin := gofakeit.Uint32()
nonceA := uint32(5)
nonceB := uint32(10)
Function printMaps
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const printMaps = async () => {
const bridgeMap = {}
console.log('Starting on chains: ', Object.keys(providers))
const rfqResponse = await fetchRfqData()
Function useToChainListArray
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useToChainListArray = (searchStr: string = '') => {
const { toChainIds } = useBridgeState()
const t = useTranslations('Bridge')
let possibleChains = _(ALL_CHAINS)
Function createApplySlippageTests
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createApplySlippageTests = (moduleSet: SynapseModuleSet) => {
describe(`${moduleSet.bridgeModuleName} module`, () => {
beforeEach(() => {
jest.spyOn(moduleSet, 'applySlippage').mockImplementation(jest.fn())
})
Function loadConfig
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
func loadConfig() *signoz.Client {
cfg := config{}
var configFormFields []huh.Field
Method ExecutorSuite.TestVerifyState
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *ExecutorSuite) TestVerifyState() {
chainID := uint32(e.TestBackendOrigin.GetChainID())
destination := uint32(e.TestBackendDestination.GetChainID())
excCfg := execConfig.Config{
Method APISuite.TestDailyStatisticsByChain
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g APISuite) TestDailyStatisticsByChain() {
chainID := g.chainIDs[0]
destinationChainIDA := g.chainIDs[1]
destinationChainIDB := g.chainIDs[2]
address := common.BigToAddress(big.NewInt(gofakeit.Int64()))
Function useFromChainListArray
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useFromChainListArray = (searchStr: string = '') => {
const { fromChainIds } = useBridgeState()
const t = useTranslations('Bridge')
Method Guard.handleStatusUpdated
has 20 return statements (exceeds 4 allowed). Open
func (g Guard) handleStatusUpdated(ctx context.Context, log ethTypes.Log, chainID uint32) error {
statusUpdated, err := g.bondingManagerParser.ParseStatusUpdated(log)
if err != nil {
return fmt.Errorf("could not parse status updated: %w", err)
}
Method txSubmitterImpl.chainPendingQueue
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *txSubmitterImpl) chainPendingQueue(parentCtx context.Context, chainID *big.Int, txes []db.TX) (err error) {
ctx, span := t.metrics.Tracer().Start(parentCtx, "submitter.ChainQueue", trace.WithAttributes(
attribute.String("chain_id", chainID.String()),
))
defer func() {
Method QuoteRequestHandler.handleProofPosted
has 70 lines of code (exceeds 50 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
}
Method BackfillSuite.withdrawAndRemoveParity
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (b *BackfillSuite) withdrawAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenWithdrawAndRemove(*log)
if err != nil {
Function TestNewBufferedPipe
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestNewBufferedPipe(t *testing.T) {
t.Run("Write and read data", func(t *testing.T) {
pipe := processlog.NewBufferedPipe()
testData := []byte("Hello, World!")
Function useSyncQueryParamsWithBridgeState
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useSyncQueryParamsWithBridgeState = () => {
const dispatch = useDispatch()
const router = useRouter()
const { fromChainId, fromToken, toChainId, toToken } = useBridgeState()