AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

Function assembleMarket has 21 arguments (exceeds 4 allowed). Consider refactoring.
Open

  marketId,
  marketData,
  marketLoading,
  marketPriceHistory,
  isOpen,
Severity: Major
Found in src/modules/markets/selectors/market.js - About 2 hrs to fix

    Function mapStateToProps has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const mapStateToProps = state => {
      const PAGINATION_COUNT = 10;
      const forkedMarket = state.universe.isForking
        ? selectMarket(state.universe.forkingMarket)
        : null;
    Severity: Major
    Found in src/modules/portfolio/containers/reports.js - About 2 hrs to fix

      Function handleFilledOnly has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function handleFilledOnly(tradeInProgress = null) {
        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 2 hrs to fix

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

          render() {
            const { closeModal, saveModal, safeLow, average, fast } = this.props;
            const { amount, showLowAlert } = this.state;
        
            const disableButton = !amount || amount < 0;
        Severity: Major
        Found in src/modules/modal/components/modal-gas-price.jsx - About 2 hrs to fix

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

            render() {
              const {
                headerHeight,
                hoveredDepth,
                isMobile,

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

              constructor(props) {
                super(props);
            
                this.periodIntervals = {
                  HOUR: 3600,

              Function mapStateToProps has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              const mapStateToProps = (
                state,
                { history, location = {}, openSubMenu = noop }
              ) => {
                const {
              Severity: Minor
              Found in src/modules/app/containers/markets-inner-nav.js - About 2 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 parseOutcomes has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function parseOutcomes(newMarketsData, outcomesData) {
                return Object.keys(newMarketsData).reduce((p, marketId) => {
                  const marketData = newMarketsData[marketId];
              
                  if (
              Severity: Major
              Found in src/modules/markets/reducers/outcomes-data.js - About 2 hrs to fix

                File reporting-report.jsx has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { Component } from "react";
                import PropTypes from "prop-types";
                import classNames from "classnames";
                import { Helmet } from "react-helmet";
                import { createBigNumber } from "utils/create-big-number";

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

                    render() {
                      const { isLogged, address, className } = this.props;
                      const s = this.state;
                  
                      return (
                  Severity: Major
                  Found in src/modules/auth/components/connect-account/connect-account.jsx - About 2 hrs to fix

                    File markets-list.test.ts has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import "jest-environment-puppeteer";
                    import Flash from "./helpers/flash";
                    import { ElementHandle } from "puppeteer";
                    import { createYesNoMarket } from "./helpers/create-markets";
                    import { IFlash, IMarket } from "./types/types";
                    Severity: Minor
                    Found in integration/markets-list.test.ts - About 2 hrs to fix

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

                        render() {
                          const { closeModal, modal } = this.props;
                      
                          return (
                            <section className={Styles.ModalView}>
                      Severity: Major
                      Found in src/modules/modal/components/modal-view.jsx - About 2 hrs to fix

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

                          render() {
                            const {
                              forkMigrationTotalsMap,
                              forkMigrationTotalWrapperHeight,
                              isOpen

                          Function updatePriceBounds has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            updatePriceBounds(
                              type,
                              selectedOutcome,
                              selectedSide,
                              orderBook,

                            Function default has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function(newMarket = DEFAULT_STATE(), action) {
                              switch (action.type) {
                                case ADD_ORDER_TO_NEW_MARKET: {
                                  const orderToAdd = action.data.order;
                                  const { quantity, price, type, orderEstimate, outcome } = orderToAdd;
                            Severity: Major
                            Found in src/modules/markets/reducers/new-market.js - About 2 hrs to fix

                              Function componentWillUpdate has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                componentWillUpdate(nextProps, nextState) {
                                  const {
                                    hoveredPrice,
                                    marketDepth,
                                    marketMax,

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

                                  render() {
                                    const { description, marketId, location, pricePrecision } = this.props;
                                    const s = this.state;
                                
                                    return (
                                Severity: Major
                                Found in src/modules/market/components/market-view/market-view.jsx - About 2 hrs to fix

                                  Function createLiquidity has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export async function createLiquidity(orders: Array<LiquidityOrder>) {
                                    let askOrders: LiquidityChartRows = {};
                                    let bidOrders: LiquidityChartRows = {};
                                    let currentOrdersArray;
                                    for (let order of orders) {
                                  Severity: Major
                                  Found in integration/helpers/liquidity.ts - About 2 hrs to fix

                                    Function reInitAugur has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export const reInitAugur = history => (dispatch, getState) => {
                                      const debounceCall = debounce((callback = cb) => {
                                        const { connection, env } = getState();
                                        if (!connection.isConnected || !connection.isConnectedToAugurNode) {
                                          dispatch(
                                    Severity: Minor
                                    Found in src/modules/app/actions/re-init-augur.js - About 2 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 MarketOutcomes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    const MarketOutcomes = ({
                                      outcomes,
                                      max,
                                      min,
                                      type,

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language