AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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

  render() {
    const { closeModal } = this.props;
    const { errors, isValid, quantity, gasEstimate, page } = this.state;
    const invalidWithErrors = !isValid && errors.length > 0;
    const formattedQuantity = formatRep(quantity || 0);
Severity: Major
Found in src/modules/modal/components/modal-participate.jsx - About 3 hrs to fix

    Function drawTicks has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function drawTicks(options) {
      const {
        drawParams,
        depthChart,
        orderBookKeys,

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

      import React, { Component } from "react";
      import PropTypes from "prop-types";
      import classNames from "classnames";
      import ScrollSnap from "scroll-snap";
      import logError from "utils/log-error";

        Function transferFunds has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function transferFunds(amount, currency, toAddress) {
          return (dispatch, getState) => {
            const { universe, loginAccount } = getState();
            const fromAddress = loginAccount.address;
            const to = speedomatic.formatEthereumAddress(toAddress);
        Severity: Major
        Found in src/modules/auth/actions/transfer-funds.js - About 3 hrs to fix

          File trading.test.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          "use strict";
          
          import "jest-environment-puppeteer";
          import { UnlockedAccounts } from "./constants/accounts";
          import { waitNextBlock } from "./helpers/wait-new-block";
          Severity: Minor
          Found in integration/trading.test.ts - About 3 hrs to fix

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

            import React, { Component } from "react";
            import PropTypes from "prop-types";
            import classNames from "classnames";
            
            import MarketOutcomeChartHeaderOrders from "modules/market-charts/components/market-outcome-charts--header-orders/market-outcome-charts--header-orders";

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

                render() {
                  const {
                    indexArray,
                    addresses,
                    clickAction,
              Severity: Major
              Found in src/modules/auth/components/common/address-picker-content.jsx - About 3 hrs to fix

                File market-properties.jsx has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { Component } from "react";
                import PropTypes from "prop-types";
                import classNames from "classnames";
                
                import MarketLink from "modules/market/components/market-link/market-link";
                Severity: Minor
                Found in src/modules/market/components/market-properties/market-properties.jsx - About 3 hrs to fix

                  Function wrapLogHandler has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const wrapLogHandler = (logHandler = defaultLogHandler) => (
                    dispatch,
                    getState
                  ) => (err, log) => {
                    if (err) return console.error((log || {}).eventName, err, log);
                  Severity: Minor
                  Found in src/modules/events/actions/wrap-log-handler.js - 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

                  Function loadTransactions has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function loadTransactions(dispatch, getState, options, cb) {
                    const allOptions = Object.assign(options, {
                      orderState: augur.constants.ORDER_STATE.ALL
                    });
                    dispatch(updateAppStatus(TRANSACTIONS_LOADING, true));
                  Severity: Major
                  Found in src/modules/auth/actions/load-account-history.js - About 3 hrs to fix

                    Function helpers has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const helpers = store => {
                      const { dispatch, whenever } = store;
                      return {
                        updateAccountAddress: account =>
                          new Promise(resolve => {
                    Severity: Major
                    Found in src/helpers/helpers.js - About 3 hrs to fix

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

                        render() {
                          const { history, location, transactionsLoading } = this.props;
                          const {
                            lowerBound,
                            boundedLength,
                      Severity: Major
                      Found in src/modules/portfolio/components/transactions/transactions.jsx - About 3 hrs to fix

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

                        import React from "react";
                        import PropTypes from "prop-types";
                        
                        import ValueDenomination from "modules/common/components/value-denomination/value-denomination";
                        import classNames from "classnames";
                        Severity: Minor
                        Found in src/modules/trading/components/trading--confirm/trading--confirm.jsx - About 3 hrs to fix

                          File init-augur.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import * as AugurJS from "services/augurjs";
                          import { updateEnv } from "modules/app/actions/update-env";
                          import {
                            updateConnectionStatus,
                            updateAugurNodeConnectionStatus,
                          Severity: Minor
                          Found in src/modules/app/actions/init-augur.js - About 3 hrs to fix

                            File account-withdraw.jsx has 306 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";
                            
                            
                            Severity: Minor
                            Found in src/modules/account/components/account-withdraw/account-withdraw.jsx - About 3 hrs to fix

                              Function selectMarketsInDisputeSelector has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  (markets, disputeOutcomes, universe) => {
                                    if (isEmpty(markets)) {
                                      return [];
                                    }
                                    let filteredMarkets = markets.filter(
                              Severity: Major
                              Found in src/modules/reports/selectors/select-dispute-markets.js - About 3 hrs to fix

                                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

                                    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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language