oceanprotocol/market

View on GitHub

Showing 27 of 90 total issues

Function OrbisProvider has a Cognitive Complexity of 89 (exceeds 10 allowed). Consider refactoring.
Open

function OrbisProvider({ children }: { children: ReactNode }): ReactElement {
  const { address: accountId } = useAccount()
  const { data: signer } = useSigner()
  const web3Provider = useProvider()
  const prevAccountId = usePrevious(accountId)
Severity: Minor
Found in src/@context/DirectMessages/index.tsx - About 1 day 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 FilterPrice has a Cognitive Complexity of 49 (exceeds 10 allowed). Consider refactoring.
Open

export default function FilterPrice({
  serviceType,
  accessType,
  setServiceType,
  setAccessType,
Severity: Minor
Found in src/components/Search/Filters.tsx - About 6 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 DmConversation has a Cognitive Complexity of 48 (exceeds 10 allowed). Consider refactoring.
Open

export default function DmConversation() {
  const {
    orbis,
    account,
    conversationId,
Severity: Minor
Found in src/components/@shared/DirectMessages/Conversation.tsx - About 6 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 PublishPage has a Cognitive Complexity of 33 (exceeds 10 allowed). Consider refactoring.
Open

export default function PublishPage({
  content
}: {
  content: { title: string; description: string; warning: string }
}): ReactElement {
Severity: Minor
Found in src/components/Publish/index.tsx - About 4 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 secondsToString has a Cognitive Complexity of 29 (exceeds 10 allowed). Consider refactoring.
Open

export function secondsToString(numberOfSeconds: number): string {
  if (numberOfSeconds === 0) return 'Forever'

  const years = Math.floor(numberOfSeconds / 31536000)
  const months = Math.floor((numberOfSeconds %= 31536000) / 2630000)
Severity: Minor
Found in src/@utils/ddo.ts - About 3 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 Postbox has a Cognitive Complexity of 29 (exceeds 10 allowed). Consider refactoring.
Open

export default function Postbox({
  replyTo = null,
  cancelReplyTo,
  callback
}: {
Severity: Minor
Found in src/components/@shared/DirectMessages/Postbox.tsx - About 3 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 Actions has a Cognitive Complexity of 25 (exceeds 10 allowed). Consider refactoring.
Open

export default function Actions({
  scrollToRef,
  did
}: {
  scrollToRef: RefObject<any>
Severity: Minor
Found in src/components/Publish/Actions/index.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 getAlgoHelpText has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.
Open

function getAlgoHelpText(
  dtSymbolSelectedComputeAsset: string,
  dtBalanceSelectedComputeAsset: string,
  isConsumable: boolean,
  isAlgorithmConsumable: boolean,
Severity: Minor
Found in src/components/Asset/AssetActions/ButtonBuy/index.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 Download has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.
Open

export default function Download({
  asset,
  file,
  isBalanceSufficient,
  dtBalance,
Severity: Minor
Found in src/components/Asset/AssetActions/Download/index.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 NetworkIcon has a Cognitive Complexity of 22 (exceeds 10 allowed). Consider refactoring.
Open

export function NetworkIcon({ name }: { name: string }): ReactElement {
  const IconMapped = name.includes('ETH')
    ? EthIcon
    : name.includes('Polygon') || name.includes('Mumbai')
    ? PolygonIcon
Severity: Minor
Found in src/components/@shared/NetworkName/NetworkIcon.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 PageSearch has a Cognitive Complexity of 22 (exceeds 10 allowed). Consider refactoring.
Open

export default function PageSearch(): ReactElement {
  const router = useRouter()
  const parsed = router.query
  const { text, owner, tags, categories } = parsed
  const [totalResults, setTotalResults] = useState<number>()
Severity: Minor
Found in src/pages/search.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 Edit has a Cognitive Complexity of 22 (exceeds 10 allowed). Consider refactoring.
Open

export default function Edit({
  asset
}: {
  asset: AssetExtended
}): ReactElement {
Severity: Minor
Found in src/components/Asset/Edit/EditMetadata.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 Pagination has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
Open

export default function Pagination({
  totalPages,
  currentPage,
  rowsPerPage,
  rowCount,
Severity: Minor
Found in src/components/@shared/Pagination/index.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 getConsumeHelpText has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
Open

function getConsumeHelpText(
  btSymbol: string,
  dtBalance: string,
  dtSymbol: string,
  hasDatatoken: boolean,
Severity: Minor
Found in src/components/Asset/AssetActions/ButtonBuy/index.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 getAlgoHelpText has 11 arguments (exceeds 6 allowed). Consider refactoring.
Open

  dtSymbolSelectedComputeAsset: string,
  dtBalanceSelectedComputeAsset: string,
  isConsumable: boolean,
  isAlgorithmConsumable: boolean,
  hasPreviousOrderSelectedComputeAsset: boolean,
Severity: Major
Found in src/components/Asset/AssetActions/ButtonBuy/index.tsx - About 1 hr to fix

    Function getAccessDetailsFromTokenPrice has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring.
    Open

    function getAccessDetailsFromTokenPrice(
      tokenPrice: TokenPrice,
      timeout?: number
    ): AccessDetails {
      const accessDetails = {} as AccessDetails
    Severity: Minor
    Found in src/@utils/accessDetailsAndPricing.ts - About 55 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 Header has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring.
    Open

    export default function Header() {
      const { address: accountId } = useAccount()
      const {
        conversations,
        conversationId,
    Severity: Minor
    Found in src/components/@shared/DirectMessages/Header.tsx - About 55 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 CustomProvider has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
    Open

    export default function CustomProvider(props: InputProps): ReactElement {
      const { chain } = useNetwork()
      const newCancelToken = useCancelToken()
      const { initialValues, setFieldError } = useFormikContext<FormPublishData>()
      const [field, meta, helpers] = useField(props.name)
    Severity: Minor
    Found in src/components/@shared/FormInput/InputElement/Provider/index.tsx - About 45 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 getFileInfo has 8 arguments (exceeds 6 allowed). Consider refactoring.
    Open

      file: string,
      providerUrl: string,
      storageType: string,
      query?: string,
      headers?: KeyValuePair[],
    Severity: Major
    Found in src/@utils/provider.ts - About 45 mins to fix

      Function order has 7 arguments (exceeds 6 allowed). Consider refactoring.
      Open

        signer: Signer,
        asset: AssetExtended,
        orderPriceAndFees: OrderPriceAndFees,
        accountId: string,
        hasDatatoken: boolean,
      Severity: Major
      Found in src/@utils/order.ts - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language