trufflesuite/truffle

View on GitHub

Showing 685 of 1,401 total issues

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

export function one<O extends {}, K extends string>(
  options: O,
  expectedKeys: K[]
): asserts options is HasOne<O, K> {
  const found = expectedKeys.some(key => {
Severity: Minor
Found in packages/expect/src/index.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 useStyles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const useStyles = createStyles((theme, _params, _getRef) => ({
  maxHeight: {
    height: "100%"
  },
  sourceContent: {
Severity: Minor
Found in packages/dashboard/src/components/composed/Debugger/Sources/index.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 DecodeTransactionResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const DecodeTransactionResult = ({
  decoder,
  transaction,
  receipt
}: Props) => {
Severity: Minor
Found in packages/db-kit/src/cli/decodeTransaction/Result.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 Sources has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function Sources({
  sources,
  session,
  sessionUpdated,
  unknownAddresses,
Severity: Minor
Found in packages/dashboard/src/components/composed/Debugger/Sources/index.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 fetchTransactionInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function fetchTransactionInfo({
  config,
  transactionHash
}: FetchTransactionInfoOptions): {
  transaction: Promise<Transaction>;
Severity: Minor
Found in packages/db-kit/src/cli/decodeTransaction/useTransactionInfo.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

Severity
Category
Status
Source
Language