AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function setAccountDisputeData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setAccountDisputeData(accountDisputeData) {
    const { stakeInfo, updateState } = this.props;
    if (stakeInfo && createBigNumber(stakeInfo.repValue).gt(ZERO)) {
      delete accountDisputeData.validations.stake;
    }

    Function verifyLiquidity has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export async function verifyLiquidity(
      orders: Array<LiquidityOrder>,
      timeoutMilliseconds = 10000
    ) {
      for (let i = 0; i < orders.length; i++) {
    Severity: Minor
    Found in integration/helpers/liquidity.ts - About 1 hr to fix

      Function validateOutcomes has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        validateOutcomes(value, index) {
          const { isValid, newMarket, updateNewMarket } = this.props;
          const { currentStep } = newMarket;
      
          const updatedMarket = { ...newMarket };

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

                test(`market.outcomes[${i}].id`, () => {
                  expect(outcome.id).toBeDefined();
                  expect(typeof outcome.id).toBe("string");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

                test(`market.outcomes[${i}].trade.maxNumShares`, () => {
                  expect(trade.maxNumShares).toBeDefined();
                  expect(typeof trade.maxNumShares).toBe("number");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

                test(`market.outcomes[${i}].trade.updateTradeOrder`, () => {
                  expect(trade.updateTradeOrder).toBeDefined();
                  expect(typeof trade.updateTradeOrder).toBe("function");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

        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 yScale = d3
            .scaleLinear()
            .clamp(true)
            .domain(d3.extent(yDomain))
            .range([containerHeight - chartDim.bottom, chartDim.top]);
        src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 441..445

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

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

                test(`market.tags[${i}].onCLick`, () => {
                  expect(tag.onClick).toBeDefined();
                  expect(typeof tag.onClick).toBe("function");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

                test(`market.outcomes[${i}].marketId`, () => {
                  expect(outcome.marketId).toBeDefined();
                  expect(typeof outcome.marketId).toBe("string");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

        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 yScale = d3
            .scaleLinear()
            .clamp(true)
            .domain(d3.extent(yDomain))
            .range([containerHeight - chartDim.bottom, chartDim.top]);
        src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 424..428

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

        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

            store.dispatch(
              placeTrade({
                marketId: "testYesNoMarketId",
                outcomeId: "1",
                tradeInProgress: {
        Severity: Major
        Found in src/modules/trades/actions/place-trade.test.js and 1 other location - About 1 hr to fix
        src/modules/trades/actions/place-trade.test.js on lines 109..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 61.

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

              test(`market.tradeSummary.tradeOrders${i}.description`, () => {
                expect(trade.description).toBeDefined();
                expect(typeof trade.description).toBe("string");
              });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327

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

        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

          constructor(props) {
            super(props);
        
            this.state = {
              outcomeWrapperHeight: 0,
        src/modules/create-market/components/create-market-preview-categorical/create-market-preview-categorical.jsx on lines 18..27

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

        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

            store.dispatch(
              placeTrade({
                marketId: "testYesNoMarketId",
                outcomeId: "1",
                tradeInProgress: {
        Severity: Major
        Found in src/modules/trades/actions/place-trade.test.js and 1 other location - About 1 hr to fix
        src/modules/trades/actions/place-trade.test.js on lines 74..87

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

        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

          constructor(props) {
            super(props);
        
            this.state = {
              outcomeWrapperHeight: 0,
        src/modules/market/components/market-outcomes-categorical/market-outcomes-categorical.jsx on lines 53..62

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

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

                test(`market.outcomes[${i}].name`, () => {
                  expect(outcome.name).toBeDefined();
                  expect(typeof outcome.name).toBe("string");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

                test(`market.outcomes[${i}].trade.limitPrice`, () => {
                  expect(trade.limitPrice).toBeDefined();
                  expect(typeof trade.limitPrice).toBe("number");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

                test(`market.tags[${i}].name`, () => {
                  expect(tag.name).toBeDefined();
                  expect(typeof tag.name).toBe("string");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

                test(`market.outcomes[${i}].trade.numShares`, () => {
                  expect(trade.numShares).toBeDefined();
                  expect(typeof trade.numShares).toBe("number");
                });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 304..307
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

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

              test(`market.tradeSummary.tradeOrders${i}.limitPrice`, () => {
                expect(trade.limitPrice).toBeDefined();
                expect(typeof trade.limitPrice).toBe("number");
              });
        Severity: Major
        Found in src/assertions/market.js and 13 other locations - About 1 hr to fix
        src/assertions/market.js on lines 86..89
        src/assertions/market.js on lines 91..94
        src/assertions/market.js on lines 108..111
        src/assertions/market.js on lines 113..116
        src/assertions/market.js on lines 118..121
        src/assertions/market.js on lines 142..145
        src/assertions/market.js on lines 147..150
        src/assertions/market.js on lines 152..155
        src/assertions/market.js on lines 157..160
        src/assertions/market.js on lines 168..171
        src/assertions/market.js on lines 315..318
        src/assertions/market.js on lines 324..327
        src/assertions/market.js on lines 339..342

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

        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