XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

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

            <Button
              title="Remove Favorite"
              variant="contained"
              onClick={(e) => {
                e.stopPropagation()
packages/sdk/packages/address/packages/render/src/components/favorite/PopperButtonGroup.tsx on lines 17..26

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

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 QuadkeyHeatMapRenderer: React.FC<QuadkeyHeatMapInnerProps> = ({ ...props }) => {
  return (
    <MapBoxInstanceProvider>
      <QuadkeyHeatMapInner {...props} />
    </MapBoxInstanceProvider>
packages/plugins/packages/elevation-quadkey/src/components/ElevationQuadkeyMap.tsx on lines 86..92

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

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 handleNextButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {
    paginationDispatch('nextPage', 'click', (page + 1)?.toString())
    onPageChange(event, page + 1)
  }
packages/sdk/packages/payload/packages/table/src/components/Table/TablePagination.tsx on lines 32..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 61.

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

export const getEtherchainV2Transformer = (payload?: EthereumGasEtherchainV2Payload): GasPriceWitnessUIBasePayload | undefined => {
  if (payload) {
    return {
      gasPrice: [
        {

    Function getEtherscanTransformer has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    export const getEtherscanTransformer = (payload?: EthereumGasEtherscanPayload): GasPriceWitnessUIBasePayload | undefined => {
      if (payload) {
        return {
          baseFee: {
            label: 'suggestBaseFee',

    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 useModuleDetails has a Cognitive Complexity of 11 (exceeds 5 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 () => {

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

    export const ResolvedDivinerProvider = <D,>({
      diviner: divinerProp, required = false, children, context,
    }: DivinerProviderProps<D>) => {
      const [diviner, setDiviner] = useResetState<D | undefined>(divinerProp)
    
    
    Severity: Minor
    Found in packages/sdk/packages/shared/src/contexts/diviner/Provider.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 NodeRelationalGraphFlexBox has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      ({
        actions, children, node, layout, layoutOptions, showDetails, detail, options, onHover, ...props
      }, ref) => {
        const theme = useTheme()
        const [cy, setCy] = useState<Core>()

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

    export const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {
      const { payload } = useResolvePayload()
      const {
        activePlugin: ActivePlugin, plugins, hideElementsConfig,
      } = useEmbedPluginState()

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

    export const DrawerEx: React.FC<DrawerExProps> = ({
      children,
      heightVariant = 'full',
      subTitle,
      title,
    Severity: Minor
    Found in packages/sdk/packages/drawer/src/components/Drawer.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 StatsModal has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const StatsModal: React.FC = () => {
      const [open, setOpen] = React.useState(false)
      const handleOpen = () => setOpen(true)
      const handleClose = () => setOpen(false)
    
    
    Severity: Minor
    Found in packages/sdk/packages/os/src/components/Profile/StatsModal.tsx - About 1 hr to fix

      Function SeedPhraseDialogInner has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = (props) => {
        const {
          overwriteWarning, seedPhrase, validPhrase,
        } = useSeedPhrase()
      
      

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

              {
                geometry: {
                  coordinates: [-114.012_248_483_981_61, 35.253_890_707_983_544],
                  type: 'Point',
                },
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 18..31
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 46..59
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 88..101
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 102..115
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 116..129
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 144..157
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 158..171

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

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

              {
                geometry: {
                  coordinates: [-114.012_875_267_414_61, 35.254_026_059_199_525],
                  type: 'Point',
                },
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 32..45
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 46..59
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 88..101
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 102..115
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 116..129
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 144..157
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 158..171

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

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

              {
                geometry: {
                  coordinates: [-89.284_175_483_532_56, 42.073_117_831_973_4],
                  type: 'Point',
                },
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 18..31
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 32..45
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 46..59
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 88..101
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 116..129
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 144..157
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 158..171

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

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

              {
                geometry: {
                  coordinates: [-83.2376, 33.0787],
                  type: 'Point',
                },
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 18..31
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 32..45
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 46..59
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 88..101
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 102..115
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 116..129
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 158..171

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

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

              {
                geometry: {
                  coordinates: [-114.012_586_628_555_8, 35.253_906_794_035_18],
                  type: 'Point',
                },
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 18..31
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 32..45
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 46..59
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 88..101
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 102..115
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 144..157
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 158..171

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

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

              {
                geometry: {
                  coordinates: [-94.818, 43.4017],
                  type: 'Point',
                },
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 18..31
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 32..45
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 46..59
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 88..101
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 102..115
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 116..129
        packages/plugins/packages/location-points-map/src/components/storyPayload.tsx on lines 144..157

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

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

        export const useCytoscapeElements = (mod?: WeakRef<ModuleInstance> | null) => {
          const [elements, setElements] = useState<ElementDefinition[]>([])
        
          useAsyncEffect(
        
        

          Function SocialLinks has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const SocialLinks: React.FC<FlexBoxProps> = (props) => {
            return (
              <FooterLinks title="XYO Socials" {...props}>
                <FlexRow flexWrap="wrap" justifyContent="flex-start">
                  <FooterLink href="https://business.facebook.com/OfficialXYO/">
          Severity: Minor
          Found in packages/sdk/packages/footer/src/Xyo/SocialLinks.tsx - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language