XYOracleNetwork/sdk-xyo-react-js

View on GitHub

Showing 124 of 486 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 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 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 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

Severity
Category
Status
Source
Language