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

  render() {
    const {
      recipient,
      unclaimedRep,
      unclaimedEth,
src/modules/modal/components/modal-claim-reporting-fees-forked-market.jsx on lines 84..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 297.

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 create-market-form-liquidity.jsx has 704 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint jsx-a11y/label-has-for: 0 */
/* eslint react/no-array-index-key: 0 */

import React, { Component } from "react";
import PropTypes from "prop-types";

    Function marketId has 322 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          (
            marketId,
            marketData,
            marketLoading,
            marketPriceHistory,
    Severity: Major
    Found in src/modules/markets/selectors/market.js - About 1 day to fix

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

        render() {
          const {
            market,
            currentTimestamp,
            tentativeWinner,
      Severity: Major
      Found in src/modules/market/components/core-properties/core-properties.jsx - About 1 day to fix

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

          render() {
            const {
              newMarket,
              validateField,
              keyPressed,

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

            test(`categorical market with invalid disputes`, () => {
              const stakes = [
                {
                  payout: [1429, 1429, 1429, 1429, 1429, 1429, 1429],
                  isInvalid: true,
          src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 610..647

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

          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

            test(`categorical market with one disputes`, () => {
              const stakes = [
                {
                  payout: [10003, 0, 0, 0, 0, 0, 0],
                  isInvalid: false,
          src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 528..559

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

          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 market-outcome-charts--candlestick.jsx has 665 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from "react";
          import PropTypes from "prop-types";
          import CustomPropTypes from "utils/custom-prop-types";
          import * as d3 from "d3";
          import ReactFauxDOM from "react-faux-dom";

            File app.jsx has 640 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // TODO -- this component needs to be broken up
            //         all logic related to sidebar(s) need to be housed w/in a separate component
            
            import React, { Component } from "react";
            import PropTypes from "prop-types";
            Severity: Major
            Found in src/modules/app/components/app/app.jsx - About 1 day to fix

              File market-outcome-charts--depth.jsx has 639 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Component } from "react";
              import PropTypes from "prop-types";
              import * as d3 from "d3";
              import ReactFauxDOM from "react-faux-dom";
              
              

                File trading--form.jsx has 624 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* eslint jsx-a11y/label-has-for: 0 */
                import { augur } from "services/augurjs";
                import React, { Component } from "react";
                import PropTypes from "prop-types";
                import classNames from "classnames";
                Severity: Major
                Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 day to fix

                  File reporting-dispute-form.jsx has 621 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* eslint jsx-a11y/label-has-for: 0 */
                  
                  import React, { Component } from "react";
                  import PropTypes from "prop-types";
                  import classNames from "classnames";

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

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

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

                        render() {
                          const { newMarket, keyPressed } = this.props;
                          const s = this.state;
                          const cleanedOutcomes = newMarket.outcomes.filter(
                            outcome => outcome !== ""

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

                          render() {
                            const {
                              fixedPrecision,
                              pricePrecision,
                              orderBook,

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

                            render() {
                              const { isMobileSmall, newMarket, validateNumber, keyPressed } = this.props;
                              const s = this.state;
                          
                              const errors = Array.from(

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            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 and 1 other location - About 1 day to fix
                            src/modules/notifications/actions/notifications.js on lines 114..141

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

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

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

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

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

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            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 and 1 other location - About 1 day to fix
                            src/modules/notifications/actions/notifications.js on lines 70..97

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

                            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 create-market-form-outcome.jsx has 580 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* eslint jsx-a11y/label-has-for: 0 */
                            /* eslint react/no-array-index-key: 0 */
                            
                            import React, { Component } from "react";
                            import PropTypes from "prop-types";

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

                                            <div>
                                              <label htmlFor="cm__input--max">
                                                <span>&nbsp;</span>
                                              </label>
                                              <input
                              src/modules/create-market/components/create-market-form-outcome/create-market-form-outcome.jsx on lines 479..511

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

                              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