AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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(

        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";

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

            render() {
              const { market, stakeInfo, outcomes } = this.props;
              const s = this.state;
              const winner = (outcomes && outcomes.find(o => o.tentativeWinning)) || {};
              const disputeRound = market.disputeInfo && market.disputeInfo.disputeRound;

            File set-notification-text.js has 533 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * @todo Update text for FINALIZE once notification triggering is moved
             */
            import { augur } from "services/augurjs";
            import { isEmpty } from "lodash/fp";
            Severity: Major
            Found in src/modules/notifications/actions/set-notification-text.js - About 1 day to fix

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

                render() {
                  const p = this.props;
                  const {
                    marketType,
                    openInterest,
              Severity: Major
              Found in src/modules/market/components/market-properties/market-properties.jsx - About 1 day to fix

                File listen-to-updates.test.js has 505 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { listenToUpdates } from "modules/events/actions/listen-to-updates";
                import * as augurjs from "services/augurjs";
                import * as loadMarketsInfoModule from "modules/markets/actions/load-markets-info";
                import * as loadUnclaimedFeesModule from "modules/markets/actions/market-creator-fees-management";
                import * as convertLogsToTransactionsModule from "modules/transactions/actions/convert-logs-to-transactions";
                Severity: Major
                Found in src/modules/events/actions/listen-to-updates.test.js - About 1 day to fix

                  File market.js has 504 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                  This is one of the most important and sensitive selectors in the app.
                  It builds the fat, heavy, rigid, hierarchical market objects,
                  that are used to render and display many parts of the ui.
                  This is the point where the shallow, light, loose, flexible, independent
                  Severity: Major
                  Found in src/modules/markets/selectors/market.js - About 1 day to fix

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

                      render() {
                        const { newMarket } = this.props;
                        const s = this.state;
                    
                        return (

                      File add-transactions.js has 485 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import {
                        MARKET_CREATION,
                        PUBLIC_TRADE,
                        TRANSFER,
                        REPORTING,
                      Severity: Minor
                      Found in src/modules/transactions/actions/add-transactions.js - About 7 hrs to fix

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

                          render() {
                            const {
                              openOrders,
                              positions,
                              numCompleteSets,

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

                            render() {
                              const {
                                blockchain,
                                coreStats,
                                history,
                          Severity: Major
                          Found in src/modules/app/components/app/app.jsx - About 7 hrs to fix

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

                              render() {
                                const {
                                  isClearable,
                                  isIncrementable,
                                  incrementAmount,
                            Severity: Major
                            Found in src/modules/common/components/input/input.jsx - About 7 hrs to fix

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

                                render() {
                                  const {
                                    isMarketInValid,
                                    isOpenReporting,
                                    market,

                                Function updateChart has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  updateChart() {
                                    const { selectedSeriesData, graphPeriod, graphPeriodOptions } = this.state;
                                    const { margin } = this;
                                    const timeTickFormat = graphPeriodOptions.reduce((a, e) => {
                                      let newFormat = a;

                                  File market-portfolio-card.jsx has 460 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React, { Component } from "react";
                                  import classNames from "classnames";
                                  import PropTypes from "prop-types";
                                  
                                  import getValue from "utils/get-value";

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

                                    "use strict";
                                    
                                    import "jest-environment-puppeteer";
                                    import Flash from "../helpers/flash";
                                    import { IFlash, IMarket } from "../types/types";
                                    Severity: Minor
                                    Found in integration/reporting/reporting.test.ts - About 7 hrs to fix

                                      Function loadAccountDataFromLocalStorage has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      export const loadAccountDataFromLocalStorage = address => (
                                        dispatch,
                                        getState
                                      ) => {
                                        const localStorageRef = typeof window !== "undefined" && window.localStorage;
                                      Severity: Minor
                                      Found in src/modules/auth/actions/load-account-data-from-local-storage.js - About 6 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 render has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        render() {
                                          const {
                                            currentTimeInSeconds,
                                            fixedPrecision,
                                            pricePrecision,
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language