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

    const actual = accountTrades(
      {
        "0xMARKETID2": {
          2: [
            {
Severity: Major
Found in src/modules/positions/reducers/account-trades.test.js and 1 other location - About 3 hrs to fix
src/modules/positions/reducers/account-trades.test.js on lines 124..160

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

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

  test(`big numbers account % complete, 50 `, () => {
    const outcome = {
      bondSizeCurrent: 4000000000000000000,
      stakeCurrent: "2000000000000000000",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

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

  test(`% complete, 50 `, () => {
    const outcome = {
      bondSizeCurrent: 10,
      stakeCurrent: "5",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

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

  test(`big numbers account % complete, 10, total 50 complete `, () => {
    const outcome = {
      bondSizeCurrent: 20000000000000000000,
      stakeCurrent: "12000000000000000000",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

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

  test(`all zeros`, () => {
    const outcome = {
      bondSizeCurrent: 0,
      stakeCurrent: "0",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160

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

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

export function addOpenOrderTransactions(openOrders) {
  return (dispatch, getState) => {
    const { marketsData, transactionsData } = getState();
    // flatten open orders
    const transactions = {};
Severity: Major
Found in src/modules/transactions/actions/add-transactions.js - About 3 hrs to fix

    File submit-new-market.test.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { createBigNumber } from "utils/create-big-number";
    import thunk from "redux-thunk";
    import configureMockStore from "redux-mock-store";
    import { BUY, SELL } from "modules/transactions/constants/types";
    import { buildCreateMarket } from "modules/markets/helpers/build-create-market";
    Severity: Minor
    Found in src/modules/markets/actions/submit-new-market.test.js - About 3 hrs to fix

      Function render has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const {
            isMobile,
            market,
            marketQuantity,
      Severity: Minor
      Found in src/modules/trading/components/trading--form/trading--form.jsx - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

                <div className={Styles.TopBar__stat}>
                  <span className={Styles["TopBar__stat-label"]}>ETH</span>
                  <span className={Styles["TopBar__stat-value"]} id="core-bar-eth">
                    {props.stats[0].totalRealEth.value.formatted}
                  </span>
      Severity: Major
      Found in src/modules/app/components/top-bar/top-bar.jsx and 1 other location - About 3 hrs to fix
      src/modules/app/components/top-bar/top-bar.jsx on lines 31..36

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

      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

                <div className={Styles.TopBar__stat}>
                  <span className={Styles["TopBar__stat-label"]}>REP</span>
                  <span className={Styles["TopBar__stat-value"]} id="core-bar-rep">
                    {props.stats[0].totalRep.value.formatted}
                  </span>
      Severity: Major
      Found in src/modules/app/components/top-bar/top-bar.jsx and 1 other location - About 3 hrs to fix
      src/modules/app/components/top-bar/top-bar.jsx on lines 25..30

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

      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 notifications.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import store from "src/store";
      import { augur } from "services/augurjs";
      import * as notificationLevels from "modules/notifications/constants/notifications";
      import setNotificationText from "modules/notifications/actions/set-notification-text";
      import { createBigNumber } from "utils/create-big-number";
      Severity: Minor
      Found in src/modules/notifications/actions/notifications.js - About 3 hrs to fix

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

          fS.sorts.forEach(type => {
            expect(type.label).toBeDefined();
            expect(typeof type.label).toBe("string");
        
            expect(type.value).toBeDefined();
        Severity: Major
        Found in src/assertions/filter-sort.js and 1 other location - About 3 hrs to fix
        src/assertions/filter-sort.js on lines 22..28

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 99.

        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

        ReportingReportConfirm.propTypes = {
          selectedOutcome: PropTypes.string.isRequired,
          stake: PropTypes.string.isRequired,
          stakeLabel: PropTypes.string.isRequired,
          gasEstimate: PropTypes.string.isRequired,
        src/modules/reporting/components/reporting-report-markets/reporting-report-markets.jsx on lines 219..227

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

        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

        ReportingReporting.propTypes = {
          location: PropTypes.object.isRequired,
          history: PropTypes.object.isRequired,
          marketIds: PropTypes.object.isRequired,
          markets: PropTypes.object.isRequired,
        src/modules/reporting/components/reporting-report-confirm/reporting-report-confirm.jsx on lines 47..55

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

        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

          fS.types.forEach(type => {
            expect(type.label).toBeDefined();
            expect(typeof type.label).toBe("string");
        
            expect(type.value).toBeDefined();
        Severity: Major
        Found in src/assertions/filter-sort.js and 1 other location - About 3 hrs to fix
        src/assertions/filter-sort.js on lines 30..36

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

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

        function getUniversesInfoWithParentContext(
          account,
          currentUniverseData,
          parentUniverseData,
          grandParentUniverseData,
        Severity: Major
        Found in src/modules/universe/actions/load-universe-info.js - About 3 hrs to fix

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

            render() {
              const { selectedPeriod, selectedRange } = this.props;
          
              const s = this.state;
          
          

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

              render() {
                const {
                  isMobile,
                  marketId,
                  outcomes,

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

                render() {
                  const {
                    filteredMarkets,
                    history,
                    isLogged,
              Severity: Major
              Found in src/modules/markets-list/components/markets-list.jsx - About 3 hrs to fix

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

                  test(`Updates the Augur Node connection in state`, () => {
                    const action = {
                      type: updateConnection.UPDATE_AUGUR_NODE_CONNECTION_STATUS,
                      data: { isConnectedToAugurNode: true }
                    };
                Severity: Major
                Found in src/modules/app/reducers/connection.test.js and 2 other locations - About 3 hrs to fix
                src/modules/app/reducers/connection.test.js on lines 8..17
                src/modules/app/reducers/connection.test.js on lines 41..50

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

                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