AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

      jest
        .spyOn(augur.api.Universe, "getReputationToken")
        .mockImplementation((args, callback) => {
          expect(args).toEqual({
            tx: { to: "0xUNIVERSE" }
Severity: Major
Found in src/modules/forking/actions/submit-migrate-rep.test.js and 1 other location - About 1 hr to fix
src/modules/forking/actions/get-fork-migration-totals.test.js on lines 34..41

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

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 mergeProps has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const mergeProps = (sP, dP, oP) => {
  const { marketId, cb } = sP.modal;
  const market = selectMarket(marketId);
  const { description, outstandingReturns } = market;
  const { gasCost } = sP;
Severity: Minor
Found in src/modules/modal/containers/modal-claim-trading-proceeds.js - About 1 hr to fix

    Function assertMyMarkets has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function assertMyMarkets(market) {
      describe(`myMarket's shape`, () => {
        test("id", () => {
          expect(market.id).toBeDefined();
          expect(typeof market.id).toBe("string");
    Severity: Minor
    Found in src/assertions/my-markets.js - About 1 hr to fix

      Function getMainMenuData has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        getMainMenuData() {
          const { currentBasePath } = this.props;
          return [
            {
              label: "Positions",
      Severity: Minor
      Found in src/modules/app/components/inner-nav/portfolio-inner-nav.jsx - About 1 hr to fix

        Function orderAndAssignCumulativeShares has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          (orderBook, userOpenOrders, loginAccount) => {
            const rawBids = ((orderBook || {})[BIDS] || []).slice();
            const bids = rawBids.sort((a, b) => b.price.value - a.price.value).reduce(
              (p, order, i, orders) => [
                ...p,
        Severity: Minor
        Found in src/modules/markets/helpers/order-and-assign-cumulative-shares.js - About 1 hr to fix

          Function validateType has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            validateType(value) {
              const { isValid, newMarket, updateNewMarket } = this.props;
              const updatedMarket = { ...newMarket };
              const validations = updatedMarket.validations[newMarket.currentStep];
          
          

            Function validateTag has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              validateTag(fieldName, value, maxLength, isRequired = true) {
                const { isValid, newMarket, updateNewMarket } = this.props;
                const { currentStep } = newMarket;
                const { localValues } = this.state;
                const updatedMarket = { ...newMarket };

              Function calculateMarketCreationCosts has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                calculateMarketCreationCosts() {
                  const { meta, universe, newMarket, gasPrice } = this.props;
              
                  augur.createMarket.getMarketCreationCostBreakdown(
                    { universe: universe.id, meta },

                Function componentWillReceiveProps has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  componentWillReceiveProps(nextProps, nextState) {
                    const { newMarket, gasPrice } = this.props;
                    if (
                      newMarket.initialLiquidityEth !== nextProps.newMarket.initialLiquidityEth
                    )

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

                    describe("scalar 75", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketScalar,
                          [2500, 7500],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 53..63
                  src/utils/calculate-payout-numerators-value.test.js on lines 65..75
                  src/utils/calculate-payout-numerators-value.test.js on lines 77..87
                  src/utils/calculate-payout-numerators-value.test.js on lines 89..99
                  src/utils/calculate-payout-numerators-value.test.js on lines 101..111
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147
                  src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

                    describe("scalar sub 0 Min 73", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketScalarMin,
                          [470, 830],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 41..51
                  src/utils/calculate-payout-numerators-value.test.js on lines 53..63
                  src/utils/calculate-payout-numerators-value.test.js on lines 77..87
                  src/utils/calculate-payout-numerators-value.test.js on lines 89..99
                  src/utils/calculate-payout-numerators-value.test.js on lines 101..111
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147
                  src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

                    describe("scalar sub 0 Min 25", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketScalarMin,
                          [950, 350],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 41..51
                  src/utils/calculate-payout-numerators-value.test.js on lines 53..63
                  src/utils/calculate-payout-numerators-value.test.js on lines 65..75
                  src/utils/calculate-payout-numerators-value.test.js on lines 89..99
                  src/utils/calculate-payout-numerators-value.test.js on lines 101..111
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147
                  src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

                  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

                                {newMarket.validations[newMarket.currentStep].description && (
                                  <span className={StylesForm.CreateMarketForm__error}>
                                    {InputErrorIcon}
                                    {newMarket.validations[newMarket.currentStep].description}
                                  </span>
                  src/modules/create-market/components/create-market-form-time/create-market-form-time.jsx on lines 66..71
                  src/modules/create-market/components/create-market-form-time/create-market-form-time.jsx on lines 72..77

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

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

                    describe("yes/no YES", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketBinary,
                          [0, 10000],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 41..51
                  src/utils/calculate-payout-numerators-value.test.js on lines 53..63
                  src/utils/calculate-payout-numerators-value.test.js on lines 65..75
                  src/utils/calculate-payout-numerators-value.test.js on lines 77..87
                  src/utils/calculate-payout-numerators-value.test.js on lines 89..99
                  src/utils/calculate-payout-numerators-value.test.js on lines 101..111
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147

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

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

                    describe("scalar sub 0 Min 75", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketScalarMin,
                          [450, 850],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 41..51
                  src/utils/calculate-payout-numerators-value.test.js on lines 65..75
                  src/utils/calculate-payout-numerators-value.test.js on lines 77..87
                  src/utils/calculate-payout-numerators-value.test.js on lines 89..99
                  src/utils/calculate-payout-numerators-value.test.js on lines 101..111
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147
                  src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

                    describe("scalar 25", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketScalar,
                          [7500, 2500],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 41..51
                  src/utils/calculate-payout-numerators-value.test.js on lines 53..63
                  src/utils/calculate-payout-numerators-value.test.js on lines 65..75
                  src/utils/calculate-payout-numerators-value.test.js on lines 77..87
                  src/utils/calculate-payout-numerators-value.test.js on lines 89..99
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147
                  src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

                  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

                        {newMarket.validations[newMarket.currentStep].minute && (
                          <span className={StylesForm.CreateMarketForm__error}>
                            {InputErrorIcon}
                            {newMarket.validations[newMarket.currentStep].minute}
                          </span>
                  src/modules/create-market/components/create-market-form-define/create-market-form-define.jsx on lines 244..249
                  src/modules/create-market/components/create-market-form-time/create-market-form-time.jsx on lines 66..71

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

                  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

                        test(`market.tradeSummary.tradeOrders${i}.gas.value`, () => {
                          expect(trade.gas.value).toBeDefined();
                          expect(typeof trade.gas.value).toBe("number");
                        });
                  Severity: Major
                  Found in src/assertions/market.js and 3 other locations - About 1 hr to fix
                  src/assertions/market.js on lines 329..332
                  src/assertions/market.js on lines 334..337
                  src/assertions/market.js on lines 344..347

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

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

                        const state = {
                          universe: {
                            id: "1010101"
                          },
                          contractAddresses: {
                  Severity: Major
                  Found in src/modules/markets/actions/submit-new-market.test.js and 2 other locations - About 1 hr to fix
                  src/modules/markets/actions/submit-new-market.test.js on lines 50..67
                  src/modules/markets/actions/submit-new-market.test.js on lines 249..263

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

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

                    describe("scalar 50", () => {
                      test(`should call the expected method`, () => {
                        const actual = calculatePayoutNumeratorsValue(
                          marketScalar,
                          [5000, 5000],
                  Severity: Major
                  Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
                  src/utils/calculate-payout-numerators-value.test.js on lines 41..51
                  src/utils/calculate-payout-numerators-value.test.js on lines 53..63
                  src/utils/calculate-payout-numerators-value.test.js on lines 65..75
                  src/utils/calculate-payout-numerators-value.test.js on lines 77..87
                  src/utils/calculate-payout-numerators-value.test.js on lines 101..111
                  src/utils/calculate-payout-numerators-value.test.js on lines 113..123
                  src/utils/calculate-payout-numerators-value.test.js on lines 137..147
                  src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

                  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