AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  describe("scalar invalid", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "0", true).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130

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 138.

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 7 locations. Consider refactoring.
Open

  describe("scalar 75", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "75", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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 138.

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

    test("should handle the tradeDetails object if no shares are passed in as a buy but a limitPrice is set.", () => {
      store.dispatch(
        updateTradesInProgress({
          marketId: "testYesNoMarketId",
          outcomeId: 0,
src/modules/trades/actions/update-trades-in-progress.test.js on lines 494..519
src/modules/trades/actions/update-trades-in-progress.test.js on lines 808..833

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 138.

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 7 locations. Consider refactoring.
Open

  describe("scalar 75 sub 0 Min", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalarMin, "75", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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 138.

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 7 locations. Consider refactoring.
Open

  describe("scalar 50", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "50", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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 138.

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 7 locations. Consider refactoring.
Open

  describe("scalar 45.01", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "45.01", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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 138.

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

    test("should reset the tradeDetails object if 0 shares are passed in as a buy", () => {
      store.dispatch(
        updateTradesInProgress({
          marketId: "testCategoricalMarketId",
          outcomeId: 0,
src/modules/trades/actions/update-trades-in-progress.test.js on lines 164..189
src/modules/trades/actions/update-trades-in-progress.test.js on lines 781..806

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 138.

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

File select-migrated-totals.test.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import immutableDelete from "immutable-delete";
import {
  CATEGORICAL,
  SCALAR,
  YES_NO
Severity: Minor
Found in src/modules/reports/selectors/select-migrated-totals.test.js - About 5 hrs to fix

    Function generateTrade has 127 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      (market, outcome, outcomeTradeInProgress, orderBooks) => {
        const { loginAccount } = store.getState();
        const { settlementFee } = market;
        const side =
          (outcomeTradeInProgress && outcomeTradeInProgress.side) ||
    Severity: Major
    Found in src/modules/trades/helpers/generate-trade.js - About 5 hrs to fix

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

        const t2 = {
          description: "using global web3, global web3 network id 1, others on 4",
          stub: {
            isGlobalWeb3: () => true,
            getAugurNodeNetworkId: callback => {
      Severity: Major
      Found in src/modules/app/actions/verify-matching-network-ids.test.js and 1 other location - About 5 hrs to fix
      src/modules/app/actions/verify-matching-network-ids.test.js on lines 66..85

      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 136.

      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

        const t3 = {
          description: "using global web3, middleware network id 1, others on 4",
          stub: {
            isGlobalWeb3: () => true,
            getAugurNodeNetworkId: callback => {
      Severity: Major
      Found in src/modules/app/actions/verify-matching-network-ids.test.js and 1 other location - About 5 hrs to fix
      src/modules/app/actions/verify-matching-network-ids.test.js on lines 45..64

      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 136.

      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

        static propTypes = {
          loginWithLedger: PropTypes.func.isRequired,
          showAdvanced: PropTypes.bool.isRequired,
          showError: PropTypes.func.isRequired,
          hideError: PropTypes.func.isRequired,
      src/modules/markets-list/components/markets-header/markets-header.jsx on lines 17..28

      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 136.

      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

        static propTypes = {
          location: PropTypes.object.isRequired,
          filter: PropTypes.string.isRequired,
          sort: PropTypes.string.isRequired,
          maxFee: PropTypes.string.isRequired,
      src/modules/auth/components/ledger-connect/ledger-connect.jsx on lines 12..23

      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 136.

      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

                  <input
                    id="cm__input--tag2"
                    type="text"
                    className={classNames({
                      [`${StylesForm["CreateMarketForm__error--field"]}`]: newMarket
      src/modules/create-market/components/create-market-form-define/create-market-form-define.jsx on lines 425..439

      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 135.

      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

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

        const marketCategorical = {
          maxPrice: 100,
          minPrice: 0,
          numTicks: 10003,
          numOutcomes: 7,
      Severity: Major
      Found in src/modules/reports/selectors/select-migrated-totals.test.js and 1 other location - About 5 hrs to fix
      src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 37..53

      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 135.

      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

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

        const marketCategorical = {
          maxPrice: 100,
          minPrice: 0,
          numTicks: 10003,
          numOutcomes: 7,
      src/modules/reports/selectors/select-migrated-totals.test.js on lines 26..42

      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 135.

      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

                  <input
                    id="cm__input--tag1"
                    type="text"
                    className={classNames({
                      [`${StylesForm["CreateMarketForm__error--field"]}`]: newMarket
      src/modules/create-market/components/create-market-form-define/create-market-form-define.jsx on lines 440..454

      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 135.

      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 4 locations. Consider refactoring.
      Open

        const utils5 = [
          {
            func: "formatEther",
            denom: "ETH",
            out: {
      Severity: Major
      Found in src/utils/format-number.test.js and 3 other locations - About 4 hrs to fix
      src/utils/format-number.test.js on lines 125..156
      src/utils/format-number.test.js on lines 169..200
      src/utils/format-number.test.js on lines 213..244

      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 134.

      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 4 locations. Consider refactoring.
      Open

        const utils3 = [
          {
            func: "formatEther",
            denom: "ETH",
            out: {
      Severity: Major
      Found in src/utils/format-number.test.js and 3 other locations - About 4 hrs to fix
      src/utils/format-number.test.js on lines 125..156
      src/utils/format-number.test.js on lines 213..244
      src/utils/format-number.test.js on lines 257..288

      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 134.

      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 4 locations. Consider refactoring.
      Open

        const utils2 = [
          {
            func: "formatEther",
            denom: "ETH",
            out: {
      Severity: Major
      Found in src/utils/format-number.test.js and 3 other locations - About 4 hrs to fix
      src/utils/format-number.test.js on lines 169..200
      src/utils/format-number.test.js on lines 213..244
      src/utils/format-number.test.js on lines 257..288

      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 134.

      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