synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

//nolint:revive,golint
package bridgev1

import (
    "github.com/ethereum/go-ethereum/common"
Severity: Major
Found in services/explorer/contracts/bridge/bridgev1/withdraw.go and 1 other location - About 3 days to fix
services/explorer/contracts/bridge/withdraw.go on lines 1..206

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1664.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

//nolint:revive,golint
package bridge

import (
    "github.com/ethereum/go-ethereum/common"
Severity: Major
Found in services/explorer/contracts/bridge/withdraw.go and 1 other location - About 3 days to fix
services/explorer/contracts/bridge/bridgev1/withdraw.go on lines 1..206

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1664.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File SynapseRouter.ts has 1262 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
  BaseContract,
Severity: Major
Found in packages/sdk-router/src/typechain/SynapseRouter.ts - About 3 days to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    //nolint:golint,revive
    package bridge
    
    import (
        "github.com/ethereum/go-ethereum/common"
    Severity: Major
    Found in services/explorer/contracts/bridge/deposit.go and 1 other location - About 3 days to fix
    services/explorer/contracts/bridge/bridgev1/deposit.go on lines 1..204

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 1644.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    //nolint:golint,revive
    package bridgev1
    
    import (
        "github.com/ethereum/go-ethereum/common"
    Severity: Major
    Found in services/explorer/contracts/bridge/bridgev1/deposit.go and 1 other location - About 3 days to fix
    services/explorer/contracts/bridge/deposit.go on lines 1..204

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 1644.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File queryutils.go has 1500 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package graph
    
    import (
        "context"
        "fmt"
    Severity: Major
    Found in services/explorer/graphql/server/graph/queryutils.go - About 3 days to fix

      File SynapseCCTP.ts has 1248 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* Autogenerated file. Do not edit manually. */
      /* tslint:disable */
      /* eslint-disable */
      import type {
        BaseContract,
      Severity: Major
      Found in packages/sdk-router/src/typechain/SynapseCCTP.ts - About 3 days to fix

        Method executableSchema.Complexity has a Cognitive Complexity of 173 (exceeds 20 allowed). Consider refactoring.
        Open

        func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
            ec := executionContext{nil, e, 0, 0, nil}
            _ = ec
            switch typeName + "." + field {
        
        
        Severity: Minor
        Found in services/explorer/consumer/client/resolver-client/server.go - About 3 days to fix

        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 executableSchema.Complexity has a Cognitive Complexity of 173 (exceeds 20 allowed). Consider refactoring.
        Open

        func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
            ec := executionContext{nil, e, 0, 0, nil}
            _ = ec
            switch typeName + "." + field {
        
        
        Severity: Minor
        Found in services/scribe/graphql/server/graph/resolver/server.go - About 3 days to fix

        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

        File bridgeable.ts has 1234 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Token } from '../../types'
        import * as CHAINS from '../chains/master'
        
        const zeroAddress = '0x0000000000000000000000000000000000000000'
        const nullAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
        Severity: Major
        Found in packages/synapse-constants/src/constants/tokens/bridgeable.ts - About 3 days to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export const SYN: BridgeableToken = {
            addresses: {
              [CHAINS.ETHEREUM.id]: '0x0f2d719407fdbeff09d87557abb7232601fd9f29',
              [CHAINS.BNBCHAIN.id]: '0xa4080f1778e69467e905b8d6f72f6e441f9e9484',
              [CHAINS.POLYGON.id]: '0xf8f9efc0db77d8881500bb06ff5d6abc3070e695',
          Severity: Major
          Found in packages/rest-api/src/constants/bridgeable.ts and 1 other location - About 3 days to fix
          packages/widget/src/constants/bridgeable.ts on lines 608..657

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 532.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export const SYN: BridgeableToken = {
            addresses: {
              [CHAINS.ETHEREUM.id]: '0x0f2d719407fdbeff09d87557abb7232601fd9f29',
              [CHAINS.BNBCHAIN.id]: '0xa4080f1778e69467e905b8d6f72f6e441f9e9484',
              [CHAINS.POLYGON.id]: '0xf8f9efc0db77d8881500bb06ff5d6abc3070e695',
          Severity: Major
          Found in packages/widget/src/constants/bridgeable.ts and 1 other location - About 3 days to fix
          packages/rest-api/src/constants/bridgeable.ts on lines 608..657

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 532.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File bridgeable.ts has 1168 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { zeroAddress } from 'viem'
          import ageurLogo from '@assets/icons/ageur.svg'
          import avaxLogo from '@assets/icons/avax.svg'
          import btcLogo from '@assets/icons/btc.svg'
          import busdLogo from '@assets/icons/busd.svg'
          Severity: Major
          Found in packages/synapse-interface/constants/tokens/bridgeable.ts - About 3 days to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export const getCountdownTimeStatus = (
              startDate: Date | null,
              endDate: Date | null
            ) => {
              if (!startDate && !endDate) {
            Severity: Major
            Found in packages/widget/src/utils/getCountdownTimeStatus.ts and 1 other location - About 2 days to fix
            packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx on lines 114..197

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 481.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export const getCountdownTimeStatus = (
              startDate: Date,
              endDate: Date | null
            ) => {
              if (!startDate && !endDate) {
            packages/widget/src/utils/getCountdownTimeStatus.ts on lines 3..86

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 481.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            File synapseRouter.ts has 1073 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            export const SYNAPSE_ROUTER_ABI = [
              {
                inputs: [
                  {
                    internalType: 'address',
            Severity: Major
            Found in packages/synapse-interface/constants/abis/synapseRouter.ts - About 2 days to fix

              File i_inbox.go has 1317 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // Code generated by mockery v2.14.0. DO NOT EDIT.
              
              package mocks
              
              import (
              Severity: Major
              Found in agents/contracts/inbox/mocks/i_inbox.go - About 2 days to fix

                Function RehydrateCache has 556 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func RehydrateCache(parentCtx context.Context, client *gqlClient.Client, service cache.Service, handler metrics.Handler) (err error) {
                    traceCtx, span := handler.Tracer().Start(parentCtx, "RehydrateCache")
                    defer func() {
                        metrics.EndSpanWithErr(span, err)
                    }()
                Severity: Major
                Found in services/explorer/api/server.go - About 2 days to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  export const USDC: BridgeableToken = {
                    addresses: {
                      [CHAINS.ETHEREUM.id]: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
                      [CHAINS.OPTIMISM.id]: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
                      [CHAINS.CRONOS.id]: '0xc21223249ca28397b4b6541dffaecc539bff0c59',
                  Severity: Major
                  Found in packages/rest-api/src/constants/bridgeable.ts and 1 other location - About 2 days to fix
                  packages/widget/src/constants/bridgeable.ts on lines 423..466

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 454.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  export const USDC: BridgeableToken = {
                    addresses: {
                      [CHAINS.ETHEREUM.id]: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
                      [CHAINS.OPTIMISM.id]: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
                      [CHAINS.CRONOS.id]: '0xc21223249ca28397b4b6541dffaecc539bff0c59',
                  Severity: Major
                  Found in packages/widget/src/constants/bridgeable.ts and 1 other location - About 2 days to fix
                  packages/rest-api/src/constants/bridgeable.ts on lines 423..466

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 454.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language