AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function showEdgeLogin has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const showEdgeLogin = history => (dispatch, getState) => {
  const state = getState();
  const edgeContext = selectEdgeContextState(state);
  const edgeLoading = selectEdgeLoadingState(state);

Severity: Minor
Found in src/modules/auth/actions/show-edge-login.js - About 1 hr to fix

    Function selectAverageTradeSize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      marketPriceHistory => {
        if (!marketPriceHistory) return 0;
        const initialState = {
          shares: ZERO,
          trades: 0
    Severity: Minor
    Found in src/modules/markets/selectors/user-markets.js - About 1 hr to fix

      Function connectWallet has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async connectWallet(derivationPath) {
          const { loginWithTrezor, logout } = this.props;
          const result = await TrezorConnect.ethereumGetAddress({
            path: derivationPath
          });
      Severity: Minor
      Found in src/modules/auth/components/trezor-connect/trezor-connect.jsx - About 1 hr to fix

        Function drawSeries has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function drawSeries(options) {
          const {
            creationTime,
            drawParams,
            estimatedInitialPrice,

          Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor(props) {
              super(props);
          
              this.state = {
                outcomes: [],

            Function validateSavedValues has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              validateSavedValues() {
                const { market, outcomes } = this.props;
                const {
                  validations,
                  selectedOutcome,

              Function checkStake has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                checkStake(stakeValue, updatedValidations, maxRepObject) {
                  if (
                    stakeValue === "" ||
                    stakeValue == null ||
                    stakeValue === 0 ||

                Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  constructor(props) {
                    super(props);
                    this.state = {
                      // marketType: false,
                      outcomeFieldCount: CreateMarketOutcome.calculateOutcomeFieldCount(

                  Consider simplifying this complex logical expression.
                  Open

                            if (
                              transactionsData[key].transactions &&
                              transactionsData[key].transactions.length &&
                              transactionsData[key].transactions[0].tradeGroupId ===
                                tradeGroupId &&
                  Severity: Major
                  Found in src/modules/notifications/actions/notifications.js - About 1 hr to fix

                    Function insufficientFunds has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      validityBond,
                      gasCost,
                      designatedReportNoShowReputationBond,
                      availableEth,
                      availableRep,
                    Severity: Major
                    Found in src/modules/markets/helpers/insufficient-funds.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if (
                                    transactionsData[key].transactions &&
                                    transactionsData[key].transactions.length &&
                                    transactionsData[key].transactions[0].tradeGroupId ===
                                      tradeGroupId &&
                      Severity: Major
                      Found in src/modules/notifications/actions/notifications.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                          if (
                            type === SCALAR &&
                            (!minPrice ||
                              (!BigNumber.isBigNumber(minPrice) && isNaN(minPrice)) ||
                              !maxPrice ||
                        Severity: Major
                        Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (!isEqual(newOrderInfo, currentOrderInfo)) {
                                // trade has changed, lets update trade.
                                this.updateTrade(newStateInfo, nextProps);
                          
                                const nextTradePrice = nextProps.selectedOutcome.trade.limitPrice;
                          Severity: Major
                          Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if (orderType === LIMIT) {
                                  return (
                                    <div>
                                      <ul className={Styles["TradingForm__form-body"]}>
                                        {!isMobile &&
                            Severity: Major
                            Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  if (
                                    (isConnected !== nextProps.isConnected ||
                                      loadingState !== nextProps.loadingState) &&
                                    (nextProps.isConnected &&
                                      nextProps.loadingState === null &&
                              Severity: Major
                              Found in src/modules/market/components/market-view/market-view.jsx - About 1 hr to fix

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

                                      {
                                        payout: [6000, 4000],
                                        isInvalid: false,
                                        malformed: false,
                                        potentialFork: false,
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 139..150
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 151..162
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 163..174
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 175..186
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 199..210
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 256..267
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 268..279

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

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

                                      {
                                        payout: [2000, 8000],
                                        isInvalid: false,
                                        malformed: false,
                                        potentialFork: false,
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 139..150
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 151..162
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 175..186
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 187..198
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 199..210
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 256..267
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 268..279

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

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

                                      {
                                        payout: [1500, 8500],
                                        isInvalid: false,
                                        malformed: false,
                                        potentialFork: false,
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 139..150
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 151..162
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 163..174
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 175..186
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 187..198
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 199..210
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 256..267

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

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

                                      {
                                        payout: [1000, 9000],
                                        isInvalid: false,
                                        malformed: false,
                                        potentialFork: false,
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 151..162
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 163..174
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 175..186
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 187..198
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 199..210
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 256..267
                                src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 268..279

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

                                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

                                              className={classNames(FormStyles.Form__input, {
                                                [`${Styles.error}`]: s.errors[
                                                  this.INPUT_TYPES.MARKET_ORDER_SIZE
                                                ].length
                                              })}
                                src/modules/trading/components/trading--form/trading--form.jsx on lines 532..535
                                src/modules/trading/components/trading--form/trading--form.jsx on lines 552..554

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

                                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