XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

Function FullWidthCard has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const FullWidthCard: React.FC<FullWidthCardProps> = ({
  cardIsButton, desc, href, media, name, small, to, ...props
}) => {
  const theme = useTheme()
  const [raised, setRaised] = useState(false)

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function MemoryArchivistsStats has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const MemoryArchivistsStats: React.FC<MemoryArchivistStatsProps> = ({ archivist }) => {
  const [all, setAll] = useState<Payload[] | null>()

  const getAll = useCallback(async (archivist?: ArchivistInstance) => {
    const all = await archivist?.all?.()

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function SchemaProperty has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  ({
    showLinkNames = true, showOpenNewWindowLink = true, showStatusIcon = true, titleProps, value, ...props
  }, ref) => {
    const resolvedSchema = useResolveSchema(value)
    const [buttonRef, buttonDispatch] = useEvent<HTMLButtonElement>()

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Footer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const Footer: React.FC<FooterProps> = ({
  alwaysFooterLinksProps, children, container, dynamicHeight = false, ...props
}) => {
  const [more, setMore] = useState(false)
  const onMore = () => {
Severity: Minor
Found in packages/sdk/packages/footer/src/Footer.tsx - About 1 hr 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

    footerLinks={[
      {
        href: 'https://xylabs.com/',
        title: copyrightLinkTitle('XY Labs, Inc.'),
      },
Severity: Major
Found in packages/sdk/packages/footer/src/Xyo/AlwaysLinks.tsx and 1 other location - About 1 hr to fix
packages/sdk/packages/footer/src/Xyo/Footer.tsx on lines 14..35

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

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 QuadkeyHeatMapRenderPlugin: PayloadRenderPlugin = createPayloadRenderPlugin({
  canRender: (payload?: Payload) => payload?.schema === 'network.xyo.location.heatmap.quadkey.answer',
  components: { box: { details: QuadkeyHeatMapWithSettingsRenderer } },
  name: 'Heat Map',
})
packages/plugins/packages/pointer/src/Plugin.ts on lines 7..11

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

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 PointerRenderPlugin: PayloadRenderPlugin = createPayloadRenderPlugin({
  canRender: (payload?: Payload) => payload?.schema === 'network.xyo.pointer',
  components: { box: { details: DetailsBox } },
  name: 'Pointer',
})
Severity: Major
Found in packages/plugins/packages/pointer/src/Plugin.ts and 1 other location - About 1 hr to fix
packages/plugins/packages/location-heatmap-quadkey/src/Plugin.ts on lines 7..11

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

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

      {safeSignatures(reflection.getSignature)?.map((signature) => {
        return <ReflectionViewer marginX={1} key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />
      })}
packages/sdk/packages/typedoc/src/ReflectionViewer/Declaration.tsx on lines 34..36

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

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 footerLinks = [
  {
    href: 'https://xylabs.com/',
    title: copyrightLinkTitle('XY Labs, Inc.'),
  },
Severity: Major
Found in packages/sdk/packages/footer/src/Xyo/Footer.tsx and 1 other location - About 1 hr to fix
packages/sdk/packages/footer/src/Xyo/AlwaysLinks.tsx on lines 13..34

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

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

      {safeSignatures(reflection.setSignature)?.map((signature) => {
        return <ReflectionViewer marginX={1} key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />
      })}
packages/sdk/packages/typedoc/src/ReflectionViewer/Declaration.tsx on lines 31..33

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

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 useGetSchemaPayload has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const useGetSchemaPayload = (schema?: string) => {
  const [notFound, setNotFound] = useState(false)
  const [xyoError, setError] = useState<ModuleError>()
  const [schemaCacheEntry, setSchemaCacheEntry] = useState<SchemaCacheEntry | null | undefined>()
  const [schemaLocal, setSchemaLocal] = useState<string>()
Severity: Minor
Found in packages/sdk/packages/schema/src/hooks/useGetSchema.tsx - About 1 hr to fix

    Function useDivinePayloads has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useDivinePayloads = <T extends Payload = Payload>(
      huriList: string[],
    ): [(T | null)[] | undefined, Dispatch<(T | null)[] | undefined>, Error[] | undefined] => {
      const { diviner } = usePayloadDiviner()
      const [payloads, setPayloads] = useState<(T | null)[]>()

      Function useAddressHistory has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const useAddressHistory = (address?: Address): [BoundWitness[] | undefined, Error | undefined, () => void] => {
        const [diviner, divinerError] = useWeakDivinerFromNode(TYPES.AddressHistoryDiviner)
        const [refresh, setRefresh] = useState(1)
        const [blocks, setBlocks] = useState<BoundWitness[]>()
        const [error, setError] = useState<Error>()

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

          async xnsPurchaseAttempted<T extends TData>(fields: T | XnsPurchaseAttemptedFields) {
            await Promise.all(this.handlers.map(handler => handler.xnsPurchaseAttempted(fields)))
          }
        Severity: Major
        Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

          async viewContent<T extends TData>(fields: T | ViewContentFields) {
            await Promise.all(this.handlers.map(handler => handler.viewContent(fields)))
          }
        Severity: Major
        Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

          async xnsEstimateSuccess<T extends TData>(fields: T | XnsEstimateSuccessFields) {
            await Promise.all(this.handlers.map(handler => handler.xnsEstimateSuccess(fields)))
          }
        Severity: Major
        Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

          async xnsPurchaseSuccess<T extends TData>(fields: T | XnsPurchaseSuccessFields) {
            await Promise.all(this.handlers.map(handler => handler.xnsPurchaseSuccess(fields)))
          }
        Severity: Major
        Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

        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

            const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
              setRowsPerPage(Number.parseInt(event.target.value, 10))
              setPage(0)
            }
        packages/sdk/packages/payload/packages/table/src/components/DynamicTable/Table.tsx on lines 120..123

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

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

          async xnsEstimateFailure<T extends TData>(fields: T | XnsEstimateFailureFields) {
            await Promise.all(this.handlers.map(handler => handler.xnsEstimateFailure(fields)))
          }
        Severity: Major
        Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 58..60
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

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

          async xnsEstimateAttempted<T extends TData>(fields: T | XnsEstimateAttemptedFields) {
            await Promise.all(this.handlers.map(handler => handler.xnsEstimateAttempted(fields)))
          }
        Severity: Major
        Found in packages/sdk/packages/user-events/src/XyoUserEvents.ts and 10 other locations - About 1 hr to fix
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 54..56
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 62..64
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 66..68
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 70..72
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 74..76
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 78..80
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 82..84
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 86..88
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 90..92
        packages/sdk/packages/user-events/src/XyoUserEvents.ts on lines 94..96

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

        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