synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

File bridgeMap.ts has 2092 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export const BRIDGE_MAP = {
  '1': {
    '0x0642026E7f0B6cCaC5925b4E7Fa61384250e1701': {
      decimals: 18,
      symbol: 'H2O',
Severity: Major
Found in packages/synapse-constants/src/constants/bridgeMap.ts - About 5 days to fix

    File bridgeMap.ts has 2092 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export const BRIDGE_MAP = {
      '1': {
        '0x0642026E7f0B6cCaC5925b4E7Fa61384250e1701': {
          decimals: 18,
          symbol: 'H2O',
    Severity: Major
    Found in packages/widget/src/constants/bridgeMap.ts - About 5 days to fix

      File bridgeMap.ts has 2092 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export const BRIDGE_MAP = {
        '1': {
          '0x0642026E7f0B6cCaC5925b4E7Fa61384250e1701': {
            decimals: 18,
            symbol: 'H2O',
      Severity: Major
      Found in packages/rest-api/src/constants/bridgeMap.ts - About 5 days to fix

        Method executableSchema.Complexity has a Cognitive Complexity of 281 (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/graphql/server/graph/resolver/server.go - About 5 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

        Function RehydrateCache has a Cognitive Complexity of 241 (exceeds 20 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: Minor
        Found in services/explorer/api/server.go - About 4 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 SynapseBridge.ts has 1633 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/SynapseBridge.ts - About 4 days to fix

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

          const nest_results = (sqlResults: any[]) => {
            return sqlResults.map((transaction: any) => {
              const bridgeRequest: { [key: string]: any } = {}
              const bridgeRelay: { [key: string]: any } = {}
              const bridgeProof: { [key: string]: any } = {}
          Severity: Major
          Found in packages/rfq-indexer/api/src/graphql/resolvers.ts and 1 other location - About 4 days to fix
          packages/rfq-indexer/api/src/utils/nestResults.ts on lines 1..58

          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 734.

          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

          export const nest_results = (sqlResults: any[]) => {
            return sqlResults.map((transaction: any) => {
              const bridgeRequest: { [key: string]: any } = {}
              const bridgeRelay: { [key: string]: any } = {}
              const bridgeProof: { [key: string]: any } = {}
          Severity: Major
          Found in packages/rfq-indexer/api/src/utils/nestResults.ts and 1 other location - About 4 days to fix
          packages/rfq-indexer/api/src/graphql/resolvers.ts on lines 110..167

          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 734.

          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 sdk.test.ts has 1565 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { Provider } from '@ethersproject/abstract-provider'
          import { BigNumber, PopulatedTransaction } from 'ethers'
          import { AddressZero, Zero } from '@ethersproject/constants'
          import { parseFixed } from '@ethersproject/bignumber'
          
          
          Severity: Major
          Found in packages/sdk-router/src/sdk.test.ts - About 4 days to fix

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

                describe('CCTPRouterQuery', () => {
                  // 1M in 6 decimals
                  const query: CCTPRouterQuery = {
                    routerAdapter: '1',
                    tokenOut: '2',
            Severity: Major
            Found in packages/sdk-router/src/module/query.test.ts and 1 other location - About 4 days to fix
            packages/sdk-router/src/module/query.test.ts on lines 130..210

            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 698.

            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

                describe('RouterQuery', () => {
                  // 1M in 18 decimals
                  const query: RouterQuery = {
                    swapAdapter: '1',
                    tokenOut: '2',
            Severity: Major
            Found in packages/sdk-router/src/module/query.test.ts and 1 other location - About 4 days to fix
            packages/sdk-router/src/module/query.test.ts on lines 212..292

            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 698.

            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 FastBridge.ts has 1401 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/FastBridge.ts - About 3 days to fix

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

              import { ZeroAddress } from 'ethers'
              import { BridgeableToken } from 'types'
              
              import { CHAINS } from '@/constants/chains'
              
              
              Severity: Major
              Found in packages/widget/src/constants/bridgeable.ts - About 3 days to fix

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

                import { BridgeableToken } from '../types'
                import { CHAINS } from './chains'
                
                const NativeTokenAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
                
                
                Severity: Major
                Found in packages/rest-api/src/constants/bridgeable.ts - About 3 days to fix

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

                  export const SynapseLogoSvg = () => {
                    return (
                      <svg
                        width="39"
                        height="36"
                  packages/synapse-interface/components/layouts/LandingPageWrapper/SynapseLogoSvg.tsx on lines 113..219

                  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 598.

                  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 function SynapseLogoSvg() {
                    return (
                      <svg
                        width="39"
                        height="36"
                  packages/explorer-ui/components/layouts/MainLayout/SynapseLogoSvg.tsx on lines 1..107

                  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 598.

                  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 chain_test.go has 1584 lines of code (exceeds 500 allowed). Consider refactoring.
                  Open

                  package backfill_test
                  
                  import (
                      gosql "database/sql"
                      "fmt"
                  Severity: Major
                  Found in services/explorer/backfill/chain_test.go - About 3 days to fix

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

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

                    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 1674.

                    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,dupl
                    package bridge
                    
                    import (
                        "github.com/ethereum/go-ethereum/common"
                    Severity: Major
                    Found in services/explorer/contracts/bridge/mint.go and 1 other location - About 3 days to fix
                    services/explorer/contracts/bridge/bridgev1/mint.go on lines 1..207

                    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 1674.

                    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

                    Method executableSchema.Complexity has 692 lines of code (exceeds 50 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: Major
                    Found in services/explorer/graphql/server/graph/resolver/server.go - About 3 days to fix
                      Severity
                      Category
                      Status
                      Source
                      Language