AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  render() {
    const {
      history,
      isLogged,
      isOpenReporting,

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

        const {
          marketType,
          openInterest,
          volume,
          isForking,
    src/modules/portfolio/components/portfolio-reports/portfolio-reports.jsx on lines 97..124

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

    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

        prePromise = new Promise(resolve => {
          augur.augurNode.submitRequest(
            "getMarkets",
            {
              reportingState: constants.REPORTING_STATE.PRE_REPORTING,
    Severity: Major
    Found in src/modules/reports/actions/load-reporting.js and 1 other location - About 5 hrs to fix
    src/modules/reports/actions/load-reporting.js on lines 73..91

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

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

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

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

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

    Refactorings

    Further Reading

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

        const {
          currentTimestamp,
          finalizeMarket,
          forkedMarket,
          reportingFees,
    src/modules/market/components/market-properties/market-properties.jsx on lines 108..135

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

    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

        designatedPromise = new Promise(resolve => {
          augur.augurNode.submitRequest(
            "getMarkets",
            {
              reportingState: constants.REPORTING_STATE.DESIGNATED_REPORTING,
    Severity: Major
    Found in src/modules/reports/actions/load-reporting.js and 1 other location - About 5 hrs to fix
    src/modules/reports/actions/load-reporting.js on lines 53..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 142.

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

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

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

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

    Refactorings

    Further Reading

    File init-augur.test.js has 388 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import thunk from "redux-thunk";
    import configureMockStore from "redux-mock-store";
    import realStore from "src/store";
    import * as augur from "services/augurjs";
    
    
    Severity: Minor
    Found in src/modules/app/actions/init-augur.test.js - About 5 hrs to fix

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

      export const Close = (
        <svg viewBox="0 0 24 24">
          <defs />
          <g
            id="Symbols"
      Severity: Major
      Found in src/modules/common/components/icons.jsx and 1 other location - About 5 hrs to fix
      src/modules/common/components/icons.jsx on lines 877..901

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

      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

      export const CloseBlack = (
        <svg viewBox="0 0 24 24">
          <defs />
          <g
            id="Symbols"
      Severity: Major
      Found in src/modules/common/components/icons.jsx and 1 other location - About 5 hrs to fix
      src/modules/common/components/icons.jsx on lines 817..841

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

      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 (transaction.symbol === "ether") {
              meta.value = `${
                formatAttoEth(transaction.value, { decimals: 4, roundUp: true })
                  .formatted
              }`;
      Severity: Major
      Found in src/modules/transactions/actions/add-transactions.js and 1 other location - About 5 hrs to fix
      src/modules/transactions/actions/add-transactions.js on lines 151..172

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

      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

            } else if (
              transaction.symbol === "REP" ||
              (transaction.market === "0x0000000000000000000000000000000000000000" &&
                transaction.eventName === "TokensTransferred")
            ) {
      Severity: Major
      Found in src/modules/transactions/actions/add-transactions.js and 1 other location - About 5 hrs to fix
      src/modules/transactions/actions/add-transactions.js on lines 134..172

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

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

        render() {
          const {
            currentTimestamp,
            finalizeMarket,
            forkedMarket,

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

          render() {
            const {
              isLoading,
              error,
              walletName,
        Severity: Major
        Found in src/modules/auth/components/common/hardware-wallet.jsx - About 5 hrs to fix

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

              marketId2_sell: [
                { outcome: 1, type: SELL, price: 0.1, timestamp: 3333 },
                { outcome: 1, type: SELL, price: 0.2, timestamp: 2222 },
                { outcome: 1, type: SELL, price: 0.3, timestamp: 1111 },
                { outcome: 2, type: SELL, price: 0.6, timestamp: 3333 },
          src/modules/markets/selectors/select-market-outcome-trading-indicator.test.js on lines 8..15

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

              marketId2_buy: [
                { outcome: 1, type: BUY, price: 0.1, timestamp: 3333 },
                { outcome: 1, type: BUY, price: 0.2, timestamp: 2222 },
                { outcome: 1, type: BUY, price: 0.3, timestamp: 1111 },
                { outcome: 2, type: BUY, price: 0.6, timestamp: 3333 },
          src/modules/markets/selectors/select-market-outcome-trading-indicator.test.js on lines 16..23

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 138.

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

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

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

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

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language