synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

package backend_test

import (
    "testing"
    "time"
Severity: Major
Found in services/scribe/backend/suite_test.go and 1 other location - About 1 day to fix
services/scribe/service/indexer/suite_test.go on lines 1..74

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

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

import {
  BUSD,
  USDT,
  USDC,
  DAI,
Severity: Major
Found in packages/explorer-ui/utils/styles/coins.ts - About 1 day to fix

    Method BridgeParser.ParseLog has a Cognitive Complexity of 69 (exceeds 20 allowed). Consider refactoring.
    Open

    func (p *BridgeParser) ParseLog(log ethTypes.Log, chainID uint32) (*model.BridgeEvent, bridgeTypes.EventLog, error) {
        logTopic := log.Topics[0]
    
        iFace, err := func(log ethTypes.Log) (bridgeTypes.EventLog, error) {
            switch logTopic {
    Severity: Minor
    Found in services/explorer/consumer/parser/bridgeparser.go - About 1 day 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

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

                  <div className="flex justify-center rounded-md border-l-0 border-gray-700 border-opacity-70 bg-[#333333]  bg-opacity-30  py-[9px] px-3">
                    <div
                      className="mx-1 form-check form-check-inline"
                      onClick={() => setWalletLocale(!walletLocale)}
                    >
    packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx on lines 313..350

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

    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

                      <div className="ml-4 w-fit flex justify-center rounded-md border-l-0 border-gray-700 border-opacity-70 bg-[#333333]  bg-opacity-30 py-[9px] px-3">
                        <div
                          className="mx-2 form-check form-check-inline"
                          onClick={() => setChainsLocale(!chainsLocale)}
                        >
    packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx on lines 226..263

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

    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

        it('Handles lowercase token addresses', async () => {
          const amounts: Record<string, BigNumber> = {}
          amounts[ARB_NETH.toLowerCase()] = BigNumber.from(10).pow(18)
          amounts[ARB_WETH.toLowerCase()] = BigNumber.from(10).pow(18).mul(2)
          const result = await synapse.calculateAddLiquidity(
    Severity: Major
    Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
    packages/sdk-router/src/sdk.test.ts on lines 1669..1683

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

    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

        it('Handles uppercase token addresses', async () => {
          const amounts: Record<string, BigNumber> = {}
          amounts[ARB_NETH.toUpperCase()] = BigNumber.from(10).pow(18)
          amounts[ARB_WETH.toLowerCase()] = BigNumber.from(10).pow(18).mul(2)
          const result = await synapse.calculateAddLiquidity(
    Severity: Major
    Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
    packages/sdk-router/src/sdk.test.ts on lines 1653..1667

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

    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

    package testutil
    
    import (
        "github.com/ethereum/go-ethereum/common/compiler"
        "github.com/synapsecns/sanguine/ethergo/contracts"
    Severity: Major
    Found in services/explorer/testutil/contracttype.go and 1 other location - About 1 day to fix
    services/explorer/testutil/testcontracts/contracttype.go on lines 1..110

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

    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

    package testcontracts
    
    import (
        "github.com/ethereum/go-ethereum/common/compiler"
        "github.com/synapsecns/sanguine/ethergo/contracts"
    Severity: Major
    Found in services/explorer/testutil/testcontracts/contracttype.go and 1 other location - About 1 day to fix
    services/explorer/testutil/contracttype.go on lines 1..110

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

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

    import { Chain } from '../../types'
    
    export const ETH: Chain = {
      priorityRank: 100,
      id: 1,
    Severity: Major
    Found in packages/synapse-constants/src/constants/chains/master.ts - About 1 day to fix

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

        const [getDailyStatisticsByChain, { loading: loadingDailyData }] =
          useLazyQuery(DAILY_STATISTICS_BY_CHAIN, {
            onCompleted: (data) => {
              let chartData = data.dailyStatisticsByChain
              if (dailyStatisticCumulative) {
      Severity: Major
      Found in packages/explorer-ui/components/pages/Home/index.tsx and 1 other location - About 1 day to fix
      packages/explorer-ui/pages/chain/[chainId].tsx on lines 64..82

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

      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 [getDailyStatisticsByChain, { loading: loadingDailyData }] =
          useLazyQuery(DAILY_STATISTICS_BY_CHAIN, {
            onCompleted: (data) => {
              let chartData = data.dailyStatisticsByChain
              if (dailyStatisticCumulative) {
      Severity: Major
      Found in packages/explorer-ui/pages/chain/[chainId].tsx and 1 other location - About 1 day to fix
      packages/explorer-ui/components/pages/Home/index.tsx on lines 58..76

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

      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 index.tsx has 505 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import toast from 'react-hot-toast'
      import { useEffect, useRef, useState } from 'react'
      import { Address, zeroAddress, isAddress } from 'viem'
      import { polygon } from 'viem/chains'
      import { useAccount } from 'wagmi'
      Severity: Major
      Found in packages/synapse-interface/pages/state-managed-bridge/index.tsx - About 1 day to fix

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

        export const OPTIMISM_ETH_SWAP_TOKEN = new Token({
          addresses: {
            [CHAINS.OPTIMISM.id]: '0x4619a06ddd3b8f0f951354ec5e75c09cd1cd1aef',
          },
          decimals: 18,
        Severity: Major
        Found in packages/synapse-interface/constants/tokens/poolMaster.ts and 2 other locations - About 1 day to fix
        packages/synapse-interface/constants/tokens/poolMaster.ts on lines 582..611
        packages/synapse-interface/constants/tokens/poolMaster.ts on lines 644..673

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

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

        export const BOBA_ETH_SWAP_TOKEN = new Token({
          addresses: {
            [CHAINS.BOBA.id]: '0x498657f2AF18D525049dE520dD86ee376Db9c67c',
          },
          decimals: 18,
        Severity: Major
        Found in packages/synapse-interface/constants/tokens/poolMaster.ts and 2 other locations - About 1 day to fix
        packages/synapse-interface/constants/tokens/poolMaster.ts on lines 582..611
        packages/synapse-interface/constants/tokens/poolMaster.ts on lines 613..642

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

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

        export const ARBITRUM_ETH_SWAP_TOKEN = new Token({
          addresses: {
            [CHAINS.ARBITRUM.id]: '0xD70A52248e546A3B260849386410C7170c7BD1E9',
          },
          decimals: 18,
        packages/synapse-constants/src/constants/tokens/poolMaster.ts on lines 612..641
        packages/synapse-constants/src/constants/tokens/poolMaster.ts on lines 643..672

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

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

        export const ARBITRUM_ETH_SWAP_TOKEN = new Token({
          addresses: {
            [CHAINS.ARBITRUM.id]: '0xD70A52248e546A3B260849386410C7170c7BD1E9',
          },
          decimals: 18,
        Severity: Major
        Found in packages/synapse-interface/constants/tokens/poolMaster.ts and 2 other locations - About 1 day to fix
        packages/synapse-interface/constants/tokens/poolMaster.ts on lines 613..642
        packages/synapse-interface/constants/tokens/poolMaster.ts on lines 644..673

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

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

        export const BOBA_ETH_SWAP_TOKEN = new Token({
          addresses: {
            [CHAINS.BOBA.id]: '0x498657f2AF18D525049dE520dD86ee376Db9c67c',
          },
          decimals: 18,
        packages/synapse-constants/src/constants/tokens/poolMaster.ts on lines 581..610
        packages/synapse-constants/src/constants/tokens/poolMaster.ts on lines 612..641

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

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

        export const OPTIMISM_ETH_SWAP_TOKEN = new Token({
          addresses: {
            [CHAINS.OPTIMISM.id]: '0x4619a06ddd3b8f0f951354ec5e75c09cd1cd1aef',
          },
          decimals: 18,
        packages/synapse-constants/src/constants/tokens/poolMaster.ts on lines 581..610
        packages/synapse-constants/src/constants/tokens/poolMaster.ts on lines 643..672

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

        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

              [
                'AVAX-1284',
                'AVAX-1666600000',
                'AVAX-43114',
                'AVAX-53935',
        Severity: Major
        Found in packages/synapse-interface/__tests__/getFromTokens.test.ts and 1 other location - About 1 day to fix
        packages/synapse-interface/__tests__/getToTokens.test.ts on lines 402..597

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

        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