AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  showMore() {
    const outcomeWrapperHeight = this.state.isOpen
      ? 0
      : `${this.outcomeTable.clientHeight}px`;

src/modules/market/components/market-outcomes-categorical/market-outcomes-categorical.jsx on lines 64..73

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

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 (asks[outcome]) {
      asks[outcome].sort(compareAskPrices);
      Object.keys(asks[outcome]).forEach(index => {
        sortedOrderBook[outcome].push(asks[outcome][index]);
      });
Severity: Major
Found in src/modules/orders/helpers/liquidity.js and 1 other location - About 2 hrs to fix
src/modules/orders/helpers/liquidity.js on lines 24..29

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

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

    stub: {
      isGlobalWeb3: () => false,
      getAugurNodeNetworkId: callback => {
        callback(null, "4");
        return { type: "TEST" };
Severity: Major
Found in src/modules/app/actions/verify-matching-network-ids.test.js and 1 other location - About 2 hrs to fix
src/modules/app/actions/verify-matching-network-ids.test.js on lines 110..122

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

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(`empty object`, () => {
    const outcome = {};
    const disputeBond = 0;
    const actual = fillDisputeOutcomeProgess(disputeBond, outcome);
    const expected = {
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 179..188

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

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(`empty object with bond`, () => {
    const outcome = {};
    const disputeBond = 10;
    const actual = fillDisputeOutcomeProgess(disputeBond, outcome);
    const expected = {
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 190..199

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

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

    stub: {
      isGlobalWeb3: () => false,
      getAugurNodeNetworkId: callback => {
        callback(null, "1");
        return { type: "TEST" };
Severity: Major
Found in src/modules/app/actions/verify-matching-network-ids.test.js and 1 other location - About 2 hrs to fix
src/modules/app/actions/verify-matching-network-ids.test.js on lines 89..101

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

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 (bids[outcome]) {
      bids[outcome].sort(compareBidPrices);
      Object.keys(bids[outcome]).forEach(index => {
        sortedOrderBook[outcome].push(bids[outcome][index]);
      });
Severity: Major
Found in src/modules/orders/helpers/liquidity.js and 1 other location - About 2 hrs to fix
src/modules/orders/helpers/liquidity.js on lines 30..35

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

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

Function loadReportingWindowBounds has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const loadReportingWindowBounds = (callback = logError) => (
  dispatch,
  getState
) => {
  const { universe, loginAccount } = getState();
Severity: Major
Found in src/modules/reports/actions/load-reporting-window-bounds.js - About 2 hrs to fix

    Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const { error, connect } = this.props;
        return (
          <div
            ref={error => {
    Severity: Major
    Found in src/modules/auth/components/common/error-container.jsx - About 2 hrs to fix

      Function updateNotification has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function updateNotification(id, notification) {
        return (dispatch, getState) => {
          const callback = notification => {
            const fullNotification = {
              type: UPDATE_NOTIFICATION,
      Severity: Major
      Found in src/modules/notifications/actions/notifications.js - About 2 hrs to fix

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

        export default function(marketUserDataNavItems) {
          expect(marketUserDataNavItems).toBeDefined();
          expect(typeof marketUserDataNavItems).toBe("object");
        
          Object.keys(marketUserDataNavItems).forEach(navItem => {
        Severity: Major
        Found in src/assertions/market-user-data-nav-items.js and 3 other locations - About 2 hrs to fix
        src/assertions/market-data-nav-items.js on lines 3..10
        src/assertions/market-reporting-nav-items.js on lines 3..10
        src/assertions/outcome-trade-nav-items.js on lines 3..10

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

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

            test("should pass shape tests for Selling 10 shares of Outcome 0 at the default limitPrice", () => {
              store.dispatch(
                updateTradesInProgress({
                  marketId: "testCategoricalMarketId",
                  outcomeId: 0,
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

        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

              next => {
                if (
                  allOptions.transactionType !== ALL &&
                  allOptions.transactionType !== TRANSFER
                ) {
        Severity: Major
        Found in src/modules/auth/actions/load-account-history.js and 3 other locations - About 2 hrs to fix
        src/modules/auth/actions/load-account-history.js on lines 64..77
        src/modules/auth/actions/load-account-history.js on lines 92..105
        src/modules/auth/actions/load-account-history.js on lines 106..119

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

        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

              next => {
                if (
                  allOptions.transactionType !== ALL &&
                  allOptions.transactionType !== MARKET_CREATION
                ) {
        Severity: Major
        Found in src/modules/auth/actions/load-account-history.js and 3 other locations - About 2 hrs to fix
        src/modules/auth/actions/load-account-history.js on lines 64..77
        src/modules/auth/actions/load-account-history.js on lines 78..91
        src/modules/auth/actions/load-account-history.js on lines 106..119

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

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

            test("should pass shape tests for Selling 10 shares of outcome 1 at the default limitPrice", () => {
              store.dispatch(
                updateTradesInProgress({
                  marketId: "testScalarMarketId",
                  outcomeId: 1,
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691

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

        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

        export default function(marketDataNavItems) {
          expect(marketDataNavItems).toBeDefined();
          expect(typeof marketDataNavItems).toBe("object");
        
          Object.keys(marketDataNavItems).forEach(navItem => {
        Severity: Major
        Found in src/assertions/market-data-nav-items.js and 3 other locations - About 2 hrs to fix
        src/assertions/market-reporting-nav-items.js on lines 3..10
        src/assertions/market-user-data-nav-items.js on lines 3..10
        src/assertions/outcome-trade-nav-items.js on lines 3..10

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

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

            test("should pass shape tests for buying 10 shares of YES at the default limitPrice", () => {
              store.dispatch(
                updateTradesInProgress({
                  marketId: "testYesNoMarketId",
                  outcomeId: 0,
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

        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

              next => {
                if (
                  allOptions.transactionType !== ALL &&
                  allOptions.transactionType !== REPORTING
                ) {
        Severity: Major
        Found in src/modules/auth/actions/load-account-history.js and 3 other locations - About 2 hrs to fix
        src/modules/auth/actions/load-account-history.js on lines 64..77
        src/modules/auth/actions/load-account-history.js on lines 78..91
        src/modules/auth/actions/load-account-history.js on lines 92..105

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

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

            test("should pass shape tests for Selling 10 shares of YES at the default limitPrice", () => {
              store.dispatch(
                updateTradesInProgress({
                  marketId: "testYesNoMarketId",
                  outcomeId: 1,
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

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

            test("should pass shape tests for buying 10 shares of outcome1 at the default limitPrice", () => {
              store.dispatch(
                updateTradesInProgress({
                  marketId: "testScalarMarketId",
                  outcomeId: 1,
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
        src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

        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