XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 124 of 486 total issues

Function useModuleDetails has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useModuleDetails = (rootModule?: WeakRef<ModuleInstance> | null, onFoundModule?: () => void) => {
  const { cy } = useCytoscapeInstance()
  const [moduleAddress, setModuleAddress] = useState<string | null>()

  const [foundModule] = usePromise(async () => {

    Function MaxAccountsTableRow has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    export const MaxAccountsTableRow: React.FC<MaxAccountsTableRow> = ({
      activeAccountIndex, changeMaxAccounts, maxAccounts,
    }) => {
      const [desiredMaximumAccounts, setDesiredMaximumAccounts] = useState<number | undefined>()
      const [showSnackBar, setShowSnackBar] = 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 MapboxPointsFlexBox has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    export const MapboxPointsFlexBox: React.FC<MapboxPointsFlexBoxProps> = ({
      accessToken,
      features,
      fitToPointsPadding = 20,
      layers,
    Severity: Minor
    Found in packages/sdk/packages/map/src/Components/MapBoxPoints.tsx - About 2 hrs 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

    Function InputFieldsStack has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const InputFieldsStack: React.FC<InputFieldsStackProps> = (props) => {
      const { sx } = props
      return (
        <>
          <Stack

      File BasicHero.tsx has 251 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        Container, Grid, Typography,
      } from '@mui/material'
      import { ButtonEx } from '@xylabs/react-button'
      import type { FlexBoxProps } from '@xylabs/react-flexbox'
      Severity: Minor
      Found in packages/sdk/packages/shared/src/components/BasicHero/BasicHero.tsx - About 2 hrs to fix

        Function getEthgasstationTransformer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getEthgasstationTransformer = (payload?: EthereumGasEthgasstationPayload): GasPriceWitnessUIBasePayload | undefined => {
          if (payload) {
            return {
              baseFee: {
                label: 'baseFee',

          Function PoweredByXyo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          export const PoweredByXyo: React.FC<PoweredByXyoProps> = ({
            autoStop,
            busy,
            buttonProps,
            debugDialog = 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 XnsNameCapture has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          export const XnsNameCapture: React.FC<XnsNameCaptureProps> = ({
            autoFocus = false,
            buttonText = 'Buy My Name',
            children,
            defaultXnsName,

          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 divineIndexedResults has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          export const divineIndexedResults = async <T extends Payload = Payload>(node?: NodeInstance | null, config?: IndexedResultsConfig) => {
            let index = 0
          
            const { diviners } = config ?? {}
          
          

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

          function TablePaginationActions(props: TablePaginationActionsProps) {
            const theme = useTheme()
            const {
              count, page, rowsPerPage, onPageChange,
            } = props

            Function EmbedCardHeader has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
              const { refreshHuri, huri } = useResolvePayload()
              const {
                activePlugin, timestampLabel, hideElementsConfig,
              } = useEmbedPluginState()

              Function useSchemaStats has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const useSchemaStats = (
                statsAddress?: Address,
                nameOrAddress = TYPES.SchemaStatsDiviner,
              ): [SchemaStatsPayload[] | undefined, Error | undefined, Dispatch<SetStateAction<number>>] => {
                const [refresh, setRefresh] = useState(1)
              Severity: Minor
              Found in packages/sdk/packages/schema/src/hooks/useSchemaStats.tsx - About 1 hr to fix

                Function config has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const config: UseIndexedResultsConfig = useMemo(() => {
                    const indexedQueries = [{
                      address, chainId, implemented: true, schema: PayloadDivinerQuerySchema, tokenInterface,
                    }]
                    const config: UseIndexedResultsConfig = {

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

                  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 PayloadTableWithRef has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                    (
                      {
                        exploreDomain,
                        archive,
                        onHashClick,

                  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 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>()

                    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
                      Severity
                      Category
                      Status
                      Source
                      Language