XYOracleNetwork/plugins

View on GitHub

Showing 232 of 232 total issues

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

export const isApiUriCall = (value?: unknown): value is ApiUriCall => isApiCall(value) && !!(value as ApiUriCall).uri
packages/payloadset/packages/http/src/Payload/identity/isHttpUriCall.ts on lines 4..4
packages/payloadset/packages/api/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/api/src/Witness/Config.ts on lines 41..42
packages/payloadset/packages/http/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/http/src/Witness/Config.ts on lines 41..42

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

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

export const isApiUriCallWitnessConfig = (value?: unknown): value is ApiUriCallWitnessConfig =>
  isApiCallWitnessConfig(value) && !!(value as ApiUriCallWitnessConfig).uri
Severity: Major
Found in packages/payloadset/packages/api/src/Witness/Config.ts and 5 other locations - About 50 mins to fix
packages/payloadset/packages/api/src/Payload/identity/isApiUriCall.ts on lines 4..4
packages/payloadset/packages/http/src/Payload/identity/isHttpUriCall.ts on lines 4..4
packages/payloadset/packages/api/src/Witness/Config.ts on lines 41..42
packages/payloadset/packages/http/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/http/src/Witness/Config.ts on lines 41..42

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

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

export const isHttpUriCall = (value?: unknown): value is HttpUriCall => isHttpCall(value) && !!(value as HttpUriCall).uri
packages/payloadset/packages/api/src/Payload/identity/isApiUriCall.ts on lines 4..4
packages/payloadset/packages/api/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/api/src/Witness/Config.ts on lines 41..42
packages/payloadset/packages/http/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/http/src/Witness/Config.ts on lines 41..42

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

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

export const isHttpUriTemplateCallWitnessConfig = (value?: unknown): value is HttpUriTemplateCallWitnessConfig =>
  isHttpCallWitnessConfig(value) && !!(value as HttpUriTemplateCallWitnessConfig).uriTemplate
Severity: Major
Found in packages/payloadset/packages/http/src/Witness/Config.ts and 5 other locations - About 50 mins to fix
packages/payloadset/packages/api/src/Payload/identity/isApiUriCall.ts on lines 4..4
packages/payloadset/packages/http/src/Payload/identity/isHttpUriCall.ts on lines 4..4
packages/payloadset/packages/api/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/api/src/Witness/Config.ts on lines 41..42
packages/payloadset/packages/http/src/Witness/Config.ts on lines 37..38

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

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

export const isApiUriTemplateCallWitnessConfig = (value?: unknown): value is ApiUriTemplateCallWitnessConfig =>
  isApiCallWitnessConfig(value) && !!(value as ApiUriTemplateCallWitnessConfig).uriTemplate
Severity: Major
Found in packages/payloadset/packages/api/src/Witness/Config.ts and 5 other locations - About 50 mins to fix
packages/payloadset/packages/api/src/Payload/identity/isApiUriCall.ts on lines 4..4
packages/payloadset/packages/http/src/Payload/identity/isHttpUriCall.ts on lines 4..4
packages/payloadset/packages/api/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/http/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/http/src/Witness/Config.ts on lines 41..42

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

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

export const isHttpUriCallWitnessConfig = (value?: unknown): value is HttpUriCallWitnessConfig =>
  isHttpCallWitnessConfig(value) && !!(value as HttpUriCallWitnessConfig).uri
Severity: Major
Found in packages/payloadset/packages/http/src/Witness/Config.ts and 5 other locations - About 50 mins to fix
packages/payloadset/packages/api/src/Payload/identity/isApiUriCall.ts on lines 4..4
packages/payloadset/packages/http/src/Payload/identity/isHttpUriCall.ts on lines 4..4
packages/payloadset/packages/api/src/Witness/Config.ts on lines 37..38
packages/payloadset/packages/api/src/Witness/Config.ts on lines 41..42
packages/payloadset/packages/http/src/Witness/Config.ts on lines 41..42

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

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

Function getDomainAllowedHyphensValidator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const getDomainAllowedHyphensValidator = (
  options?: { end?: boolean; start?: boolean },
): PayloadValidationFunctionWithError<Payload<DomainFields>> => {
  return (
    payload: Payload<DomainFields>,

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

Avoid deeply nested control flow statements.
Open

          if (!distribution[property]) {
            distribution[property] = { [valueString]: 1 }
          } else if (distribution[property]![valueString]) {
            ;(distribution[property] as Record<string, number>)[valueString] += 1
          } else {

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

    export const isErc721 = async (provider: Provider, address: string) => {
      return await contractHasFunctions(provider, address, IERC721Metadata__factory.createInterface(), ['name', 'symbol', 'tokenURI'])
    }
    packages/payloadset/packages/crypto/packages/nft/packages/collection/witness/src/lib/tokenTypes.ts on lines 11..13

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

    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 isErc721 = async (provider: Provider, address: string) => {
      return await contractHasFunctions(provider, address, ERC721__factory.createInterface(), ['name', 'symbol', 'tokenURI'])
    }
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/witness/src/lib/tokenTypes.ts on lines 11..13

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

    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 type HttpUriTemplateCallWitnessConfig = WitnessConfig<
      HttpCallWitnessConfigBase & {
        params?: Record<string, string>
        uriTemplate: HttpUriTemplateCall['uriTemplate']
      }
    Severity: Minor
    Found in packages/payloadset/packages/http/src/Witness/Config.ts and 1 other location - About 40 mins to fix
    packages/payloadset/packages/api/src/Witness/Config.ts on lines 25..30

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

    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 type ApiUriTemplateCallWitnessConfig = WitnessConfig<
      ApiCallWitnessConfigBase & {
        params?: Record<string, string>
        uriTemplate: ApiUriTemplateCall['uriTemplate']
      }
    Severity: Minor
    Found in packages/payloadset/packages/api/src/Witness/Config.ts and 1 other location - About 40 mins to fix
    packages/payloadset/packages/http/src/Witness/Config.ts on lines 25..30

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

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

    export const isEthereumGasEtherscanPayload = (payload?: Payload | null): payload is EthereumGasEtherscanPayload => {
      return payload?.schema === EthereumGasEtherscanSchema
    }
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasBlocknativePayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEtherchainV2Payload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEthersPayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEthgasstationPayload.ts on lines 5..7

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

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

    export const isEthereumGasEtherchainV2Payload = (payload?: Payload | null): payload is EthereumGasEtherchainV2Payload => {
      return payload?.schema === EthereumGasEtherchainV2Schema
    }
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasBlocknativePayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEthersPayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEtherscanPayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEthgasstationPayload.ts on lines 5..7

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

    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 scoreNftYoutubeUrl = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {
      return scoreYoutubeUrl(nft?.metadata?.youtube_url)
    }
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/externalUrl.ts on lines 7..9

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

    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 type CryptoContractFunctionCallResultBase = Payload<
      {
        address: string
        args: unknown[]
        chainId: number
    packages/payloadset/packages/evm/packages/call/src/Payload.ts on lines 7..15

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

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

    export const isEthereumGasEthersPayload = (payload?: Payload | null): payload is EthereumGasEthersPayload => {
      return payload?.schema === EthereumGasEthersSchema
    }
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasBlocknativePayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEtherchainV2Payload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEtherscanPayload.ts on lines 5..7
    packages/payloadset/packages/blockchain/packages/ethereum/packages/gas/packages/gas/src/lib/identities/isEthereumGasEthgasstationPayload.ts on lines 5..7

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

    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 scoreNftDescription = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {
      return scoreDescription(nft.metadata?.description)
    }
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/animationUrl.ts on lines 11..13
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/backgroundColor.ts on lines 9..11
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/name.ts on lines 5..7

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

    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 scoreNftName = (nft: NftInfoFields | OpenSeaNftInfoFields): ScaledScore => {
      return scoreName(nft.metadata?.name)
    }
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/animationUrl.ts on lines 11..13
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/backgroundColor.ts on lines 9..11
    packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/diviner/src/lib/rating/criteria/scoring/metadata/description.ts on lines 5..7

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

    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 isErc1155 = async (provider: Provider, address: string) => {
      return await contractHasFunctions(provider, address, ERC1155URIStorage__factory.createInterface(), ['uri'])
    }
    packages/payloadset/packages/crypto/packages/nft/packages/collection/witness/src/lib/tokenTypes.ts on lines 7..9

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

    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