antoncoding/monarch

View on GitHub

Showing 27 of 95 total issues

Function useLiquidations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const useLiquidations = () => {
  const [loading, setLoading] = useState(true);
  const [isRefetching, setIsRefetching] = useState(false);
  const [liquidatedMarketIds, setLiquidatedMarketIds] = useState<Set<string>>(new Set());
  const [error, setError] = useState<unknown | null>(null);
Severity: Minor
Found in src/hooks/useLiquidations.ts - About 35 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 SupplyProcessModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function SupplyProcessModal({
  supplyAmount,
  currentStep,
  onClose,
  useEth,
Severity: Minor
Found in app/markets/components/SupplyProcessModal.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 usePermit2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function usePermit2({
  user,
  chainId = 1,
  token,
  spender,
Severity: Minor
Found in src/hooks/usePermit2.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 initAnalytics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const initAnalytics = function () {
  if (isClient()) {
    try {
      initWebVitals();
    } catch (e) {
Severity: Minor
Found in src/utils/analytics.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 RebalanceProcessModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function RebalanceProcessModal({
  currentStep,
  onClose,
  tokenSymbol,
  actionsCount,
Severity: Minor
Found in app/positions/components/RebalanceProcessModal.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 Markets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function Markets() {
  const { loading, data: rawMarkets } = useMarkets();

  // token keys, aggregated with | for each "ERC20Token" object
  const [selectedCollaterals, setSelectedCollaterals] = useState<string[]>([]);
Severity: Minor
Found in app/markets/components/markets.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 RiskIndicatorFromWarning has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function RiskIndicatorFromWarning({
  market,
  category,
  greenDescription,
  yellowDescription,
Severity: Minor
Found in app/markets/components/RiskIndicator.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

Severity
Category
Status
Source
Language