XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 476 of 476 total issues

Function ReflectionViewer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const ReflectionViewer: React.FC<ReflectionViewerProps> = ({
  variant, nameViewer, children, reflection, hiddenFlags, ...props
}) => {
  const someReflection = reflection as SomeReflection

Severity: Minor
Found in packages/sdk/packages/typedoc/src/ReflectionViewer/ReflectionViewer.tsx - About 25 mins 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 TypedModuleSummary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const TypedModuleSummary: React.FC<ModuleSummaryProps> = ({ mod, ...props }) => {
  if (isArchivistInstance(mod)) {
    return <ArchivistSummary mod={mod} {...props} />
  }
  if (isDivinerInstance(mod)) {

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

export const resolveChildren = <T extends SomeReflection>(reflection: ReflectionWithChildren, lookup: ReflectionLookup = {}): T[] => {
  return (reflection.children?.map((child) => {
    switch (typeof child) {
      case 'object': {
        return child
Severity: Minor
Found in packages/sdk/packages/typedoc/src/resolveChildren.ts - About 25 mins 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 useFetchHuri has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const useFetchHuri = (hashOrHuri?: string, diviner?: DivinerInstance, token?: string) => {
  const huri = useBuildHuri(hashOrHuri) ?? hashOrHuri
  const huriPayload: HuriPayload | undefined = useMemo(
    () => (huri
      ? {
Severity: Minor
Found in packages/sdk/packages/payload/packages/huri/src/hooks/useFetchHuri.tsx - About 25 mins 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 PointsMapInner has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const PointsMapInner: React.FC<PointsMapInnerProps> = ({
  accessToken, payload, ...props
}) => {
  const theme = useTheme()
  const locationAnswerPayload = payload && isNetworkLocationAnswer(payload) ? payload : undefined

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

export const ArchivistStats: React.FC<ArchivistStatsProps> = ({
  addresses, boundWitnesses, payloads, schemas,
}) => {
  return (
    <FlexRow gap={2} mr={0.5}>

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

export const ActiveBoundWitnessProvider: React.FC<ActiveBoundWitnessProviderProps> = ({
  children,
  activeBoundWitnessHash: activeBoundWitnessHashProp,
  archivist,
}) => {

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

export const PayloadDynamicTable: React.FC<PayloadDynamicTableProps> = ({
  archive,
  children,
  columns,
  exploreDomain,

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

export const navigateWithUsername = (xnsName: string, paramsString: string, navigate?: ((to: string) => void), to?: To) => {
  // avoid duplicating the username param
  const params = new URLSearchParams(paramsString)
  const usernameParam = params.get('username')
  if (usernameParam) {

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

export const getRemainingRowWidth = (row: HTMLElement, forCell = 0) => {
  let width = 0
  for (let i = 0; i < (row?.childElementCount ?? 0); i++) {
    const item = row?.children.item(i)
    if (item && i !== forCell) {

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

export function TablePaginationActions({
  count, enableNextPage, loading, onPageChange, page, rowsPerPage,
}: TablePaginationActionsProps) {
  const theme = useTheme()
  const [paginationRef, paginationDispatch] = useEvent<HTMLButtonElement, PaginationNouns>()

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

export const ReflectionGroupViewer: React.FC<ReflectionGroupViewerProps> = ({
  autoScroll = false,
  children,
  hiddenFlags,
  group,

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

export const DynamicTokenComparison: React.FC<TokenComparisonSummaryProps> = ({ tokenPayload }) => {
  const [baseToken0, setBaseToken0] = useState(true)
  const [tokenInfo0, tokenInfo1] = useGetTokenData([tokenPayload.tokens[baseToken0 ? 0 : 1].symbol, tokenPayload.tokens[baseToken0 ? 1 : 0].symbol])
  const token0 = tokenPayload.tokens[baseToken0 ? 0 : 1]
  const token1 = tokenPayload.tokens[baseToken0 ? 1 : 0]

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

export const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRowProps> = ({
  ignoreConnectDialog,
  onConnectClick,
  onRevoke,
  wallet,

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

export const XnsNameCaptureErrors: React.FC<XnsNameCaptureErrorsProps> = ({
  error, errorUi, resetError,
}) => {
  const theme = useTheme()
  const isMobile = useMediaQuery(theme.breakpoints.down('md'))
Severity: Minor
Found in packages/sdk/packages/xns/src/components/XnsNameCapture/Errors.tsx - About 25 mins 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 SavedPhraseTextField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const SavedPhraseTextField: React.FC<SavedPhraseTextFieldProps> = ({
  fullWidth, showPhraseHeader, ...props
}) => {
  const { validSeedPhrase, seedPhrase } = useSeedPhrase()

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

Severity
Category
Status
Source
Language