AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    history: PropTypes.shape({
      push: PropTypes.func.isRequired,
      replace: PropTypes.func.isRequired,
      createHref: PropTypes.func.isRequired
    }).isRequired
Severity: Minor
Found in src/modules/app/hocs/rewrite-url-params/index.jsx and 1 other location - About 40 mins to fix
src/modules/modal/components/common/modal-receipt.jsx on lines 22..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  test("add partial keyword and tag", () => {
    const actual = buildSearchString("bobo", ["tag1"]);
    const expected = "tags: tag1 OR bobo*";
    expect(actual).toEqual(expected);
  });
Severity: Minor
Found in src/modules/markets/selectors/build-search-string.test.js and 1 other location - About 40 mins to fix
src/modules/markets/selectors/build-search-string.test.js on lines 40..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      updateLoggedTransactionsSpy = jest
        .spyOn(convertLogsToTransactionsModule, "updateLoggedTransactions")
        .mockImplementation(log => ({
          type: ACTIONS.UPDATE_LOGGED_TRANSACTIONS,
          data: {
Severity: Minor
Found in src/modules/events/actions/log-handlers.test.js and 1 other location - About 40 mins to fix
src/modules/events/actions/log-handlers.test.js on lines 59..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <li>
              <span>Open Interest</span>
              <ValueDenomination
                valueClassname="volume"
                formatted={openInterest.full}
src/modules/market/components/market-properties/market-properties.jsx on lines 159..165

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

      <div
        ref={error => {
          this.error = error;
        }}
        className={classNames(
Severity: Major
Found in src/modules/auth/components/common/error-container.jsx and 2 other locations - About 40 mins to fix
src/modules/auth/components/common/hardware-wallet.jsx on lines 343..437
src/modules/auth/components/common/hardware-wallet.jsx on lines 353..367

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  hideError() {
    this.setState({ errorShown: false }, () => {
      toggleHeight(this.error, true, () => {});
    });
  }
Severity: Minor
Found in src/modules/auth/components/common/error-container.jsx and 1 other location - About 40 mins to fix
src/modules/auth/components/common/error-container.jsx on lines 52..56

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      getWinningBalanceSpy = jest
        .spyOn(getWinningBalanceModule, "getWinningBalance")
        .mockImplementation(marketIds => ({
          type: ACTIONS.GET_WINNING_BALANCE,
          data: {
Severity: Minor
Found in src/modules/events/actions/log-handlers.test.js and 1 other location - About 40 mins to fix
src/modules/events/actions/log-handlers.test.js on lines 38..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          if (bnAllowance.lte(0) || bnAllowance.lte(createBigNumber(cost))) {
            dispatch(
              checkAccountAllowance((err, allowance) => {
                if (allowance === "0") {
                  promptApprovalandSend();
Severity: Minor
Found in src/modules/orders/actions/liquidity-management.js and 1 other location - About 40 mins to fix
src/modules/trades/actions/place-trade.js on lines 99..114

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                  <li>
                    <span>Est. Gas</span>
                    <span>{s.formattedInitialLiquidityGas.rounded} ETH</span>
                  </li>
src/modules/create-market/components/create-market-form-review/create-market-form-review.jsx on lines 361..364

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          <div className={Styles.ReportingReport__malformed_msg}>
            <span>
              WARNING: The tentative outcome for this market is currently
              MALFORMED.
            </span>
src/modules/account/components/account-withdraw/account-withdraw.jsx on lines 237..246

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  pushDays(numberOfDays: number) {
    const args = {
      opt: {
        count: numberOfDays,
        days: true
Severity: Minor
Found in integration/helpers/flash.ts and 1 other location - About 40 mins to fix
integration/helpers/flash.ts on lines 85..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  pushWeeks(numberOfWeeks: number) {
    const args = {
      opt: {
        count: numberOfWeeks,
        weeks: true
Severity: Minor
Found in integration/helpers/flash.ts and 1 other location - About 40 mins to fix
integration/helpers/flash.ts on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

  if (
    oldUniverseData.id !== universeData.id ||
    oldUniverseData.isForking !== universeData.isForking ||
    oldUniverseData.forkingMarket !== universeData.forkingMarket ||
    oldUniverseData.forkEndTime !== universeData.forkEndTime ||
Severity: Major
Found in src/modules/universe/actions/load-universe-info.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

      if (
        order &&
        !isNaN(order.fullPrecisionPrice) &&
        !isNaN(order.fullPrecisionAmount)
      ) {
    Severity: Major
    Found in src/modules/orders/helpers/select-order-book.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

        if (
          !numShares ||
          !sharesFilled ||
          !side ||
          !type ||
      Severity: Major
      Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                  if (
                    notification.log &&
                    notifications[index].log &&
                    notification.log.eventName !== notifications[index].log.eventName &&
                    notifications[index].log.orderId &&
        Severity: Major
        Found in src/modules/notifications/actions/notifications.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

            if (meta.status === "Open" || meta.status === "Canceled") {
              return (
                <div className={Styles.TransactionMetaContainer}>
                  <ul className={Styles.TransactionMeta}>
                    {Object.keys(meta)
          Severity: Major
          Found in src/modules/portfolio/components/transaction-meta/transaction-meta.jsx - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  (isNaN(reportingFees.unclaimedEth.value) ||
                    reportingFees.unclaimedEth.formatted === "-" ||
                    reportingFees.unclaimedEth.formatted === "") &&
                  (isNaN(reportingFees.unclaimedRep.value) ||
            Severity: Major
            Found in src/modules/portfolio/components/portfolio-reports/portfolio-reports.jsx - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if (
                    newMarket.type !== nextProps.newMarket.type ||
                    newMarket.scalarSmallNum !== nextProps.newMarket.scalarSmallNum ||
                    newMarket.scalarBigNum !== nextProps.newMarket.scalarBigNum ||
                    newMarket.orderBookSorted !== nextProps.newMarket.orderBookSorted ||

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                            if (
                              !filteredMarkets[marketKey].disputeInfo.stakes[stakeKey]
                                .tentativeWinning &&
                              filteredMarkets[marketKey].disputeInfo.stakes[stakeKey]
                                .bondSizeCurrent
                src/modules/reports/selectors/select-dispute-markets.js on lines 34..58

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 48.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language