AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

File hardware-wallet.jsx has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component } from "react";
import PropTypes from "prop-types";
import { createBigNumber } from "utils/create-big-number";
import DerivationPath, {
  DEFAULT_DERIVATION_PATH,
Severity: Minor
Found in src/modules/auth/components/common/hardware-wallet.jsx - About 5 hrs to fix

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

      render() {
        const { closeModal } = this.props;
        const { didScroll, didCheck } = this.state;
    
        return (
    Severity: Major
    Found in src/modules/modal/components/modal-disclaimer.jsx - About 5 hrs to fix

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

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

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

        import thunk from "redux-thunk";
        import configureMockStore from "redux-mock-store";
        import realStore from "src/store";
        import * as augur from "services/augurjs";
        
        
        Severity: Minor
        Found in src/modules/app/actions/init-augur.test.js - About 5 hrs to fix

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

            render() {
              const {
                currentTimestamp,
                finalizeMarket,
                forkedMarket,

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

              render() {
                const {
                  isLoading,
                  error,
                  walletName,
            Severity: Major
            Found in src/modules/auth/components/common/hardware-wallet.jsx - About 5 hrs to fix

              File select-migrated-totals.test.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import immutableDelete from "immutable-delete";
              import {
                CATEGORICAL,
                SCALAR,
                YES_NO
              Severity: Minor
              Found in src/modules/reports/selectors/select-migrated-totals.test.js - About 5 hrs to fix

                Function generateTrade has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  (market, outcome, outcomeTradeInProgress, orderBooks) => {
                    const { loginAccount } = store.getState();
                    const { settlementFee } = market;
                    const side =
                      (outcomeTradeInProgress && outcomeTradeInProgress.side) ||
                Severity: Major
                Found in src/modules/trades/helpers/generate-trade.js - About 5 hrs to fix

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

                    render() {
                      const {
                        currentTimeInSeconds,
                        outcomeName,
                        hasOrders,

                    Function handleRelayTransaction has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const handleRelayTransaction = tx => (dispatch, getState) => {
                      if (tx && tx.response && tx.data) {
                        const { hash, type } = tx;
                        if (!hash) return console.error("uncaught relayed transaction", tx);
                        const { loginAccount, transactionsData } = getState();
                    Severity: Minor
                    Found in src/modules/transactions/actions/register-transaction-relay.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 render has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                        render() {
                          const {
                            collectMarketCreatorFees,
                            loadMarketsInfoIfNotLoaded,
                            history,
                      Severity: Major
                      Found in src/modules/portfolio/components/markets/markets.jsx - About 4 hrs to fix

                        Function startOrderSending has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const startOrderSending = options => (dispatch, getState) => {
                          const { marketId } = options;
                          const { loginAccount, marketsData, pendingLiquidityOrders } = getState();
                          const bnAllowance = createBigNumber(loginAccount.allowance, 10);
                          const market = marketsData[marketId];
                        Severity: Major
                        Found in src/modules/orders/actions/liquidity-management.js - About 4 hrs to fix

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

                            render() {
                              const {
                                clearSelectedOutcome,
                                description,
                                history,
                          Severity: Major
                          Found in src/modules/market/components/market-header/market-header.jsx - About 4 hrs to fix

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

                              render() {
                                const {
                                  history,
                                  isForking,
                                  isMobile,
                            Severity: Major
                            Found in src/modules/reporting/components/common/disputing-markets.jsx - About 4 hrs to fix

                              File load-universe-info.js has 360 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { augur } from "services/augurjs";
                              import { UNIVERSE_ID } from "modules/app/constants/network";
                              import logError from "utils/log-error";
                              import async from "async";
                              import { createBigNumber } from "utils/create-big-number";
                              Severity: Minor
                              Found in src/modules/universe/actions/load-universe-info.js - About 4 hrs to fix

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

                                import assertFormattedNumber from "src/assertions/common/formatted-number";
                                import assertFormattedDate from "src/assertions/common/formatted-date";
                                import assertReportableOutcomes from "src/assertions/reportable-outcomes";
                                
                                export default function(market) {
                                Severity: Minor
                                Found in src/assertions/market.js - About 4 hrs to fix

                                  Function outcomes has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                            .map(outcomeId => {
                                              const outcomeData = marketOutcomesData[outcomeId];
                                              const outcomeTradeInProgress =
                                                marketTradeInProgress && marketTradeInProgress[outcomeId];
                                              const volume = createBigNumber(outcomeData.volume);
                                  Severity: Major
                                  Found in src/modules/markets/selectors/market.js - About 4 hrs to fix

                                    Function setCurrentSegment has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      setCurrentSegment(options) {
                                        if (!options.itemsLength) return options.setSegment([]);
                                    
                                        const currentPage = parseInt(
                                          parseQuery(options.location.search)[options.pageParam] || 1,
                                    Severity: Minor
                                    Found in src/modules/common/components/paginator/paginator.jsx - 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 render has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      render() {
                                        const {
                                          isMobile,
                                          isLogged,
                                          defaultMobileClick,
                                    Severity: Major
                                    Found in src/modules/app/components/side-nav/side-nav.jsx - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language