AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function collectMarketCreatorFees has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

) => (dispatch, getState) => {
  const { loginAccount } = getState();
  if (!loginAccount.address) return callback(null);
  augur.api.Market.getMarketCreatorMailbox(
    { tx: { to: marketId } },
Severity: Major
Found in src/modules/markets/actions/market-creator-fees-management.js - About 2 hrs to fix

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

      render() {
        const {
          recipient,
          unclaimedRep,
          unclaimedEth,

      File disputing-markets.jsx has 265 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { Component } from "react";
      import PropTypes from "prop-types";
      
      import NullStateMessage from "modules/common/components/null-state-message/null-state-message";
      import DisputeMarketCard from "modules/reporting/components/dispute-market-card/dispute-market-card";
      Severity: Minor
      Found in src/modules/reporting/components/common/disputing-markets.jsx - About 2 hrs to fix

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

          render() {
            const p = this.props;
            const s = this.state;
        
            return (
        Severity: Major
        Found in src/modules/market/components/market-preview/market-preview.jsx - About 2 hrs to fix

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

              const {
                addOrderToNewMarket,
                availableEth,
                availableRep,
                categories,
          src/modules/app/components/app/app.jsx on lines 515..530
          src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 170..185
          src/modules/trading/components/trading--wrapper/trading--wrapper.jsx on lines 184..199

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

          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

              const {
                currentTimeInSeconds,
                fixedPrecision,
                pricePrecision,
                isMobile,
          src/modules/app/components/app/app.jsx on lines 515..530
          src/modules/create-market/components/create-market-form/create-market-form.jsx on lines 317..332
          src/modules/trading/components/trading--wrapper/trading--wrapper.jsx on lines 184..199

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

          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

              const {
                availableFunds,
                initialMessage,
                isLogged,
                isMobile,
          src/modules/app/components/app/app.jsx on lines 515..530
          src/modules/create-market/components/create-market-form/create-market-form.jsx on lines 317..332
          src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 170..185

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

          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

              afterEach(() => {
                store.clearActions();
                stopBlockListenersSpy.mockReset();
                stopAugurNodeEventListenersSpy.mockReset();
                startBlockListenersSpy.mockReset();
          Severity: Major
          Found in src/modules/events/actions/listen-to-updates.test.js and 1 other location - About 2 hrs to fix
          src/modules/events/actions/log-handlers.test.js on lines 82..90

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

          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

                  <li>
                    {outcomeName || orderPrice}
                    {pending && (
                      <span className={Styles.Order__pending}>
                        <span>{`${this.orderStatusText[orderCancellationStatus]}`}</span>
          src/modules/market/components/market-positions-list--orphaned-order/market-positions-list--orphaned-order.jsx on lines 74..81

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

          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

              const {
                blockchain,
                coreStats,
                history,
                isLogged,
          Severity: Major
          Found in src/modules/app/components/app/app.jsx and 3 other locations - About 2 hrs to fix
          src/modules/create-market/components/create-market-form/create-market-form.jsx on lines 317..332
          src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 170..185
          src/modules/trading/components/trading--wrapper/trading--wrapper.jsx on lines 184..199

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

          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

          function attachHoverClickHandlers({
            candleChart,
            candleDim,
            chartDim,
            containerHeight,
          src/modules/market-charts/components/market-outcome-charts/market-outcome-charts.jsx on lines 226..243

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

          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

                    <Input
                      id="modal__ethNode-input"
                      type="text"
                      className={classNames({
                        [`${Styles.ErrorField}`]: ethereumNodeInValid
          Severity: Major
          Found in src/modules/modal/components/modal-network-connect.jsx and 1 other location - About 2 hrs to fix
          src/modules/modal/components/modal-network-connect.jsx on lines 138..148

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

          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

                case SENDREPUTATION:
                  notification.title = "Send REP";
                  if (!notification.description && notification.params) {
                    notification.description = `Send ${
                      formatRep(notification.params.reputationToSend).formatted
          Severity: Major
          Found in src/modules/notifications/actions/set-notification-text.js and 1 other location - About 2 hrs to fix
          src/modules/notifications/actions/set-notification-text.js on lines 553..560

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

          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

              afterAll(() => {
                isCurrentMarketSpy.mockReset();
                updateLoggedTransactionsSpy.mockReset();
                loadReportingWindowBoundsSpy.mockReset();
                loadAccountTradesSpy.mockReset();
          Severity: Major
          Found in src/modules/events/actions/log-handlers.test.js and 1 other location - About 2 hrs to fix
          src/modules/events/actions/listen-to-updates.test.js on lines 49..57

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

          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

                case SENDETHER:
                  notification.title = "Send ETH";
                  if (!notification.description && notification.params) {
                    notification.description = `Send ${
                      formatEther(notification.params.etherToSend).formatted
          Severity: Major
          Found in src/modules/notifications/actions/set-notification-text.js and 1 other location - About 2 hrs to fix
          src/modules/notifications/actions/set-notification-text.js on lines 561..568

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

          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

                  <Input
                    id="modal__augurNode-input"
                    type="text"
                    className={classNames({
                      [`${Styles.ErrorField}`]: AugurNodeInValid
          Severity: Major
          Found in src/modules/modal/components/modal-network-connect.jsx and 1 other location - About 2 hrs to fix
          src/modules/modal/components/modal-network-connect.jsx on lines 163..173

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

          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

                  <li>
                    {outcomeName || orderPrice}
                    {pending && (
                      <span className={Styles.Order__pending}>
                        <span>{`${this.orderStatusText[orderCancellationStatus]}`}</span>
          src/modules/market/components/market-positions-list--order/market-positions-list--order.jsx on lines 103..110

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

          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 {
                currentTimeInSeconds,
                outcomeName,
                hasOrders,
                marketDepth,
          src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 644..661

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

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

          export function addTransferTransactions(transfers) {
            return dispatch => {
              const transactions = {};
              each(transfers, transfer => {
                const transaction = { ...transfer };
          Severity: Major
          Found in src/modules/transactions/actions/add-transactions.js - About 2 hrs to fix

            Function default has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function(
              numShares,
              limitPrice,
              side,
              minPrice,
            Severity: Major
            Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language