AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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

  render() {
    const {
      accountREP,
      history,
      isLogged,
Severity: Major
Found in src/modules/forking/components/migrate-rep/migrate-rep.jsx - About 4 hrs to fix

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

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

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

        render() {
          const {
            availableFunds,
            clearTradeInProgress,
            closeModal,
      Severity: Major
      Found in src/modules/trading/components/trading/trading.jsx - About 4 hrs to fix

        Function updatePriceBounds has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

          updatePriceBounds(
            type,
            selectedOutcome,
            selectedSide,
            orderBook,

        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

        File reporting-report-form.jsx has 339 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 103 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { eth, isMobileSmall, rep } = this.props;
              const s = this.state;
          
              return (
          Severity: Major
          Found in src/modules/account/components/account-withdraw/account-withdraw.jsx - About 4 hrs to fix

            File liquidity-orders.test.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              UPDATE_LIQUIDITY_ORDER,
              ADD_MARKET_LIQUIDITY_ORDERS,
              REMOVE_LIQUIDITY_ORDER,
              LOAD_PENDING_LIQUIDITY_ORDERS,
            Severity: Minor
            Found in src/modules/orders/reducers/liquidity-orders.test.js - About 4 hrs to fix

              Function cancelOpenOrdersInClosedMarkets has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

              export const cancelOpenOrdersInClosedMarkets = () => dispatch => {
                const openOrders = getOpenOrders();
                if (openOrders && openOrders.length) {
                  const numMarketsWithOpenOrders = openOrders.length;
                  for (let i = 0; i < numMarketsWithOpenOrders; ++i) {
              Severity: Minor
              Found in src/modules/orders/actions/cancel-order.js - About 4 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

              Function loadNotifications has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function loadNotifications() {
                return (dispatch, getState) => {
                  const { notifications, transactionsData } = store.getState();
                  for (let i = 0; i < notifications.length; i++) {
                    if (notifications[i].status.toLowerCase() === PENDING) {
              Severity: Major
              Found in src/modules/notifications/actions/notifications.js - About 4 hrs to fix

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

                  render() {
                    const { closeModal, handleAction, market } = this.props;
                    const { didCheck } = this.state;
                
                    const showReadMore = market.details && market.details.length > 126;
                Severity: Major
                Found in src/modules/modal/components/modal-market-review.jsx - About 4 hrs to fix

                  Function setCurrentSegment has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    setCurrentSegment(options) {
                      if (!options.itemsLength) return options.setSegment([]);
                  
                      const currentPage = parseInt(
                        parseQuery(options.location.search)[options.pageParam] || 1,
                  Severity: Major
                  Found in src/modules/common/components/paginator/paginator.jsx - About 4 hrs to fix

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

                      render() {
                        const {
                          isExtendedDisplay,
                          isMobile,
                          outcomeName,

                      File format-number.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { BigNumber, createBigNumber } from "utils/create-big-number";
                      import {
                        encodeNumberAsBase10String,
                        encodeNumberAsJSNumber,
                        unfix
                      Severity: Minor
                      Found in src/utils/format-number.js - About 3 hrs to fix

                        Function loadReporting has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const loadReporting = (marketIdsParam, callback = logError) => (
                          dispatch,
                          getState
                        ) => {
                          const { universe, loginAccount } = getState();
                        Severity: Major
                        Found in src/modules/reports/actions/load-reporting.js - About 3 hrs to fix

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

                            render() {
                              const {
                                currentTimestamp,
                                isMobile,
                                linkType,

                          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

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

                            render() {
                              const { address, openZeroExInstant, augurNodeNetworkId } = this.props;
                              const styleQR = {
                                height: "auto",
                                width: "100%"
                          Severity: Major
                          Found in src/modules/account/components/account-deposit/account-deposit.jsx - About 3 hrs to fix

                            File filter-dropdowns.jsx has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

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

                              File input.jsx has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React, { Component } from "react";
                              import PropTypes from "prop-types";
                              import classNames from "classnames";
                              import { BigNumber, createBigNumber } from "utils/create-big-number";
                              import { PulseLoader } from "react-spinners";
                              Severity: Minor
                              Found in src/modules/common/components/input/input.jsx - About 3 hrs to fix

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

                                  render() {
                                    const {
                                      defaultFilter,
                                      defaultSort,
                                      defaultMaxFee,

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

                                  import React, { Component } from "react";
                                  import PropTypes from "prop-types";
                                  import classNames from "classnames";
                                  import { Link } from "react-router-dom";
                                  import { BigNumber, createBigNumber } from "utils/create-big-number";
                                  Severity: Minor
                                  Found in src/modules/trading/components/trading--wrapper/trading--wrapper.jsx - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language