AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  componentWillReceiveProps(nextProps) {
    const { market, selectedOutcome } = this.props;
    if (
      (!isEqual(selectedOutcome, nextProps.selectedOutcome) ||
        !isEqual(market.outcomes, nextProps.market.outcomes)) &&
Severity: Minor
Found in src/modules/trading/components/trading/trading.jsx - 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 MarketLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const MarketLink = ({ linkType, className, id, children, newTab = false }) => {
  let path;

  switch (linkType) {
    case TYPE_REPORT:
Severity: Minor
Found in src/modules/market/components/market-link/market-link.jsx - 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 componentWillUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  componentWillUpdate(nextProps, nextState) {
    if (this.props.isConnected !== nextProps.isConnected)
      this.props.loadMarkets();
    if (
      this.state.lowerBound !== nextState.lowerBound ||
Severity: Minor
Found in src/modules/reporting/components/common/disputing-markets.jsx - 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 validateScalar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  validateScalar(value, humanName, min, max, tickSize, isInvalid) {
    const { updateState, validations } = this.props;
    const updatedValidations = { ...validations };
    const { inputRepAmount } = this.state;

Severity: Minor
Found in src/modules/forking/components/migrate-rep-form/migrate-rep-form.jsx - 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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      isExtendedDisplay,
      isMobile,
      outcomeName,

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

const disputeOnAllOutcomes = async (
  marketId: string,
  outcomes: Outcome[],
  isScalar: boolean = false
) => {
Severity: Minor
Found in integration/reporting/disputing.test.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 TimeRemainingIndicatorWrapper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function TimeRemainingIndicatorWrapper(BaseCmp) {
  const TimeRemainingIndicator = props => {
    const { startDate, endTime, currentTimestamp, ...otherProps } = props;

    const duration = endTime.getTime() - startDate.getTime();

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

TODO found
Open

  const payoutNumerators = reportedOutcomeId; // TODO convert reported outcome ID to payout numerators or just pass in payoutNumerators

TODO found
Open

  // TODO: verify that switching is the best way

TODO found
Open

    /* TODO */

TODO found
Open

        // TODO: Ideally, we should also be calculating depth and verifying it
Severity: Minor
Found in integration/helpers/liquidity.ts by fixme

TODO found
Open

    // TODO: Add check to verify that depth is correct
Severity: Minor
Found in integration/helpers/liquidity.ts by fixme

TODO found
Open

// TODO -- unify all occurance of `box-shadow`
Severity: Minor
Found in src/assets/styles/_box-shadow.less by fixme

TODO found
Open

// TODO -- Need to refactor z-index utilization with this
Severity: Minor
Found in src/assets/styles/_arrangement.less by fixme

TODO found
Open

  // TODO: need to sort by datetime in render

TODO found
Open

      // TODO: check which categories are present
Severity: Minor
Found in integration/markets-list.test.ts by fixme

TODO found
Open

// TODO: this should be dynamic by user control

TODO found
Open

//  Market (TODO -- These should be params, not routes)
Severity: Minor
Found in src/modules/routes/constants/views.js by fixme

TODO found
Open

// TODO -- clean up doc here

TODO found
Open

    case UPDATE_MARKETS_DATA: // TODO -- allow for the consumption of partial market objects
Severity
Category
Status
Source
Language