synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

  } else {
    return (
      <Grid cols={{ sm: 1, md: 3, lg: 3 }} gap={4} className="my-3">
        <StatCard
          title="Bridge Volume"
Severity: Major
Found in packages/explorer-ui/components/pages/Home/Stats.tsx and 1 other location - About 1 day to fix
packages/explorer-ui/components/pages/Home/Stats.tsx on lines 20..52

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

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

const SIZE_GAP_LOOKUP = {
  xs: {
    0: 'gap-0 ',
    1: 'gap-1 ',
    2: 'gap-2 ',
Severity: Major
Found in packages/explorer-ui/components/tailwind/Grid.tsx and 1 other location - About 1 day to fix
packages/synapse-interface/components/ui/tailwind/Grid.tsx on lines 113..174

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

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

  if (allTime) {
    return (
      <Grid cols={{ sm: 1, md: 3, lg: 3 }} gap={4} className="my-3">
        <AllTimeStatCard
          title="Bridge Volume"
Severity: Major
Found in packages/explorer-ui/components/pages/Home/Stats.tsx and 1 other location - About 1 day to fix
packages/explorer-ui/components/pages/Home/Stats.tsx on lines 52..84

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

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

const SIZE_GAP_LOOKUP: StyleGapLookUpInterface = {
  xs: {
    0: 'gap-0 ',
    1: 'gap-1 ',
    2: 'gap-2 ',
Severity: Major
Found in packages/synapse-interface/components/ui/tailwind/Grid.tsx and 1 other location - About 1 day to fix
packages/explorer-ui/components/tailwind/Grid.tsx on lines 106..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 287.

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

package guard_test

import (
    "context"
    "fmt"
Severity: Major
Found in agents/agents/guard/fraud_test.go - About 1 day to fix

    Function ChainSummary has 312 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const ChainSummary = () => {
      const router = useRouter()
      const { chainId: chainIdRouter } = router.query
      const [platform, setPlatform] = useState('ALL')
      const [transactionsArr, setTransactionsArr] = useState([])
    Severity: Major
    Found in packages/explorer-ui/pages/chain/[chainId].tsx - About 1 day to fix

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

        describe('#multiplty', () => {
          it('correct', () => {
            expect(
              new Fraction(JSBI.BigInt(1), JSBI.BigInt(10)).multiply(
                new Fraction(JSBI.BigInt(4), JSBI.BigInt(12))
      Severity: Major
      Found in packages/sdk-router/src/entities/fractions/fraction.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/entities/fractions/fraction.test.ts on lines 151..169

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

      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('#divide', () => {
          it('correct', () => {
            expect(
              new Fraction(JSBI.BigInt(1), JSBI.BigInt(10)).divide(
                new Fraction(JSBI.BigInt(4), JSBI.BigInt(12))
      Severity: Major
      Found in packages/sdk-router/src/entities/fractions/fraction.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/entities/fractions/fraction.test.ts on lines 132..150

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

      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 executionContext._Query has 328 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
          fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
          ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
              Object: "Query",
          })
      Severity: Major
      Found in services/explorer/consumer/client/resolver-client/server.go - About 1 day to fix

        Method executionContext._Query has 328 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
            fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
            ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
                Object: "Query",
            })
        Severity: Major
        Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 day to fix

          Method AgentsIntegrationSuite.TestAgentsE2E has 327 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (u *AgentsIntegrationSuite) TestAgentsE2E() {
              testDone := false
              defer func() {
                  testDone = true
              }()
          Severity: Major
          Found in agents/agents/agentsintegration/agentsintegration_test.go - About 1 day to fix

            Method executableSchema.Complexity has 141 return statements (exceeds 4 allowed).
            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 1 day to fix

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

              export const H2O: BridgeableToken = {
                addresses: {
                  [CHAINS.ETHEREUM.id]: '0x0642026e7f0b6ccac5925b4e7fa61384250e1701',
                  [CHAINS.ARBITRUM.id]: '0xD1c6f989e9552DB523aBAE2378227fBb059a3976',
                  [CHAINS.AVALANCHE.id]: '0xC6b11a4Fd833d1117E9D312c02865647cd961107',
              Severity: Major
              Found in packages/widget/src/constants/bridgeable.ts and 3 other locations - About 1 day to fix
              packages/rest-api/src/constants/bridgeable.ts on lines 289..318
              packages/rest-api/src/constants/bridgeable.ts on lines 522..551
              packages/widget/src/constants/bridgeable.ts on lines 522..551

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

              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 4 locations. Consider refactoring.
              Open

              export const DAI: BridgeableToken = {
                addresses: {
                  [CHAINS.ETHEREUM.id]: '0x6b175474e89094c44da98b954eedeac495271d0f',
                  [CHAINS.OPTIMISM.id]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
                  [CHAINS.POLYGON.id]: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
              Severity: Major
              Found in packages/rest-api/src/constants/bridgeable.ts and 3 other locations - About 1 day to fix
              packages/rest-api/src/constants/bridgeable.ts on lines 289..318
              packages/widget/src/constants/bridgeable.ts on lines 289..318
              packages/widget/src/constants/bridgeable.ts on lines 522..551

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

              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 4 locations. Consider refactoring.
              Open

              export const H2O: BridgeableToken = {
                addresses: {
                  [CHAINS.ETHEREUM.id]: '0x0642026e7f0b6ccac5925b4e7fa61384250e1701',
                  [CHAINS.ARBITRUM.id]: '0xD1c6f989e9552DB523aBAE2378227fBb059a3976',
                  [CHAINS.AVALANCHE.id]: '0xC6b11a4Fd833d1117E9D312c02865647cd961107',
              Severity: Major
              Found in packages/rest-api/src/constants/bridgeable.ts and 3 other locations - About 1 day to fix
              packages/rest-api/src/constants/bridgeable.ts on lines 522..551
              packages/widget/src/constants/bridgeable.ts on lines 289..318
              packages/widget/src/constants/bridgeable.ts on lines 522..551

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

              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 4 locations. Consider refactoring.
              Open

              export const DAI: BridgeableToken = {
                addresses: {
                  [CHAINS.ETHEREUM.id]: '0x6b175474e89094c44da98b954eedeac495271d0f',
                  [CHAINS.OPTIMISM.id]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
                  [CHAINS.POLYGON.id]: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
              Severity: Major
              Found in packages/widget/src/constants/bridgeable.ts and 3 other locations - About 1 day to fix
              packages/rest-api/src/constants/bridgeable.ts on lines 289..318
              packages/rest-api/src/constants/bridgeable.ts on lines 522..551
              packages/widget/src/constants/bridgeable.ts on lines 289..318

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

              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

              func (b *BackfillSuite) depositAndSwapParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                  // parse the log
                  if useV1 {
                      parsedLog, err := parser.Filterer.ParseTokenDepositAndSwap(*log)
                      if err != nil {
              Severity: Major
              Found in services/explorer/backfill/chain_test.go and 1 other location - About 1 day to fix
              services/explorer/backfill/chain_test.go on lines 1067..1131

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

              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

              func (b *BackfillSuite) redeemAndSwapParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                  // parse the log
                  if useV1 {
                      parsedLog, err := parser.Filterer.ParseTokenRedeemAndSwap(*log)
                      if err != nil {
              Severity: Major
              Found in services/explorer/backfill/chain_test.go and 1 other location - About 1 day to fix
              services/explorer/backfill/chain_test.go on lines 1000..1064

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

              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

                try {
                  // Check if input is zero
                  if (bi === 0n) {
                    return '0.0'
                  }
              Severity: Major
              Found in packages/explorer-ui/utils/formatBigIntToString.ts and 1 other location - About 1 day to fix
              packages/widget/src/utils/formatBigIntToString.ts on lines 14..52

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

              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

                try {
                  // Check if input is zero
                  if (bi === 0n) {
                    return '0.0'
                  }
              Severity: Major
              Found in packages/widget/src/utils/formatBigIntToString.ts and 1 other location - About 1 day to fix
              packages/explorer-ui/utils/formatBigIntToString.ts on lines 9..47

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

              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