XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

Function NavigationCol has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const NavigationCol: React.FC<FlexBoxProps> = (props) => {
    return (
      <FlexCol {...props}>
        <TextField
          fullWidth
Severity: Minor
Found in packages/sdk/packages/typedoc/src/TwoPanelReflectionViewer.tsx - About 1 hr to fix

    Function pollDivinersWithDelay has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const pollDivinersWithDelay = async (newDelay: number, pollingFunction?: PollingFunction) => {
        if (activePolling && maxRetries !== null && pollingFunction) {
          let retries = 0
          let result: Payload[] | undefined | null
    
    

      Function getBlocknativeTransformer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getBlocknativeTransformer = (payload?: EthereumGasBlocknativePayload): GasPriceWitnessUIBasePayload | undefined => {
        const blockPrices = payload?.blockPrices?.[0]
        if (blockPrices && blockPrices.estimatedPrices?.length) {
          const estimatedPrices = blockPrices?.estimatedPrices
          const gasPrice = estimatedPrices.map(price => ({

        Function pollDivinersWithDelay has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async (newDelay: number, functionToPoll?: FunctionToPoll) => {
              if (activePollingRef.current && maxRetries !== null && functionToPoll) {
                let retries = 0
                let result: Payload[] | undefined | null
        
        

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

          export const NftScoreRenderPlugin = {
            ...createPayloadRenderPlugin({
              canRender: (payload?: Payload) => payload?.schema === NftScoreSchema,
              components: { box: { detailsBox: NftScoreRenderer } },
              name: 'NFT Score',
          Severity: Major
          Found in packages/plugins/packages/nft-score/src/Plugin.ts and 1 other location - About 1 hr to fix
          packages/plugins/packages/location-point-map/src/Plugin.ts on lines 8..14

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

              if (routeSchema !== schema) {
                if (routeSchema === undefined && schema !== undefined) {
                  // if the route does not have a network selected, use what is in the memory context
                  setSchemaLocal(schema)
                } else if (routeSchema) {
          packages/sdk/packages/network/src/contexts/Provider/Route.tsx on lines 45..53

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

          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 [errors] = usePromise(
              async () =>
                hash && address ? await BoundWitnessValidator.validateSignature(toUint8Array(hash), toUint8Array(address), toUint8Array(signature)) : [],
              [hash, address, signature],
            )
          packages/plugins/packages/boundwitness/src/components/_shared/Signatures/SignatureTableRow.tsx on lines 35..39

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

          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 findArchivistPreset = (slug: string) => {
            return (
              archivistPresets.find((item) => {
                return item.slug === slug
              }) ?? archivistPresets[0]
          Severity: Major
          Found in packages/sdk/packages/network/src/lib/archivistPresets.ts and 1 other location - About 1 hr to fix
          packages/sdk/packages/network/src/lib/divinerPresets.ts on lines 4..10

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

              if (routeNetwork !== network) {
                if (routeNetwork === undefined && network !== undefined) {
                  // if the route does not have a network selected, use what is in the memory context
                  setNetworkParam(network)
                } else if (routeNetwork) {
          packages/sdk/packages/schema/src/contexts/Schema/Provider/Route.tsx on lines 46..54

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

          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 [errors] = usePromise(
              async () =>
                hash && address ? await BoundWitnessValidator.validateSignature(toUint8Array(hash), toUint8Array(address), toUint8Array(signature)) : [],
              [hash, address, signature],
            )
          packages/sdk/packages/block/src/components/Details/SignatureTableRow.tsx on lines 27..31

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

          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 findDivinerPreset = (slug: string) => {
            return (
              divinerPresets.find((item) => {
                return item.slug === slug
              }) ?? divinerPresets[0]
          Severity: Major
          Found in packages/sdk/packages/network/src/lib/divinerPresets.ts and 1 other location - About 1 hr to fix
          packages/sdk/packages/network/src/lib/archivistPresets.ts on lines 14..20

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

          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 PointMapRenderPlugin: PayloadRenderPlugin = {
            ...createPayloadRenderPlugin({
              canRender: (payload?: Payload) => payload?.schema === LocationSchema,
              components: { box: { detailsBox: PointMapWithSettingsRenderer } },
              name: 'Point Map',
          Severity: Major
          Found in packages/plugins/packages/location-point-map/src/Plugin.ts and 1 other location - About 1 hr to fix
          packages/plugins/packages/nft-score/src/Plugin.ts on lines 7..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 56.

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

              (noun: EventNoun, data?: Hash, clickType?: BoundwitnessClickType) => {
                // eslint-disable-next-line complexity
                void (async () => {
                  if (noun === 'boundwitness' && data) {
                    if (clickType === 'activeBoundWitness' && !hashSelectionHistory?.includes(data)) {

            Function useAccessCodes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const useAccessCodes = (localStorageKey: string, validCodeLength = 6) => {
              const [validated, setValidated] = useState(false)
              const [codeInput, setCodeInput] = useState('')
            
              const onAccessCodeSuccess = () => {
            Severity: Minor
            Found in packages/sdk/packages/access-gate/src/hooks/useAccessCodes.ts - About 1 hr to fix

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

              export const AddressRenderPlugin: PayloadRenderPlugin = {
                ...createPayloadRenderPlugin({
                  canRender: () => true,
                  components: { menu: { item: AddressMenuItemRenderer } },
                  name: 'Address',
              Severity: Major
              Found in packages/plugins/packages/address/src/Plugin.ts and 2 other locations - About 1 hr to fix
              packages/plugins/packages/default/src/Plugin.ts on lines 6..12
              packages/plugins/packages/price-forecast/src/Plugin.ts on lines 6..12

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

              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 DivinerCardActions: React.FC<ModuleRenderProps<DivinerInstance> & CardActionsProps> = (props) => {
                return <ModuleCardActions {...props} />
              }
              packages/modules/packages/archivist/src/components/Card/CardActions.tsx 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 55.

              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 ArchivistCardActions: React.FC<ModuleRenderProps<ArchivistInstance> & CardActionsProps> = (props) => {
                return <ModuleCardActions {...props} />
              }
              packages/modules/packages/module/src/components/Card/Diviner/CardActions.tsx on lines 8..10

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

              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 DefaultRenderPlugin: PayloadRenderPlugin = {
                ...createPayloadRenderPlugin({
                  canRender: () => true,
                  components: { box: { detailsBox: DetailsRenderer } },
                  name: 'Default',
              Severity: Major
              Found in packages/plugins/packages/default/src/Plugin.ts and 2 other locations - About 1 hr to fix
              packages/plugins/packages/address/src/Plugin.ts on lines 6..12
              packages/plugins/packages/price-forecast/src/Plugin.ts on lines 6..12

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

              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 PriceForecastRenderPlugin: PayloadRenderPlugin = {
                ...createPayloadRenderPlugin({
                  canRender: () => true,
                  components: { box: { detailsBox: PriceForecastDetailsBox } },
                  name: 'PriceForecast',
              Severity: Major
              Found in packages/plugins/packages/price-forecast/src/Plugin.ts and 2 other locations - About 1 hr to fix
              packages/plugins/packages/default/src/Plugin.ts on lines 6..12
              packages/plugins/packages/address/src/Plugin.ts on lines 6..12

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

              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

              const PointMapRenderer: React.FC<PointMapInnerProps> = (props) => {
                return (
                  <MapBoxInstanceProvider>
                    <PointMapInner {...props} />
                  </MapBoxInstanceProvider>
              packages/plugins/packages/location-points-map/src/components/PointsMapRenderer.tsx on lines 69..75
              packages/sdk/packages/appbar/src/components/MobileSystemControls/SystemControls.tsx on lines 7..13
              packages/sdk/packages/node-renderer/src/components/module/graph/GraphFlexBox.tsx on lines 78..84

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 54.

              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