AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

Function drawSeries has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function drawSeries(options) {
  const {
    creationTime,
    drawParams,
    estimatedInitialPrice,

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

      constructor(props) {
        super(props);
    
        this.state = {
          outcomes: [],

      Function validateSavedValues has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        validateSavedValues() {
          const { market, outcomes } = this.props;
          const {
            validations,
            selectedOutcome,

        Function checkStake has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          checkStake(stakeValue, updatedValidations, maxRepObject) {
            if (
              stakeValue === "" ||
              stakeValue == null ||
              stakeValue === 0 ||

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

            constructor(props) {
              super(props);
              this.state = {
                // marketType: false,
                outcomeFieldCount: CreateMarketOutcome.calculateOutcomeFieldCount(

            Consider simplifying this complex logical expression.
            Open

                      if (
                        transactionsData[key].transactions &&
                        transactionsData[key].transactions.length &&
                        transactionsData[key].transactions[0].tradeGroupId ===
                          tradeGroupId &&
            Severity: Major
            Found in src/modules/notifications/actions/notifications.js - About 1 hr to fix

              Function insufficientFunds has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                validityBond,
                gasCost,
                designatedReportNoShowReputationBond,
                availableEth,
                availableRep,
              Severity: Major
              Found in src/modules/markets/helpers/insufficient-funds.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if (
                              transactionsData[key].transactions &&
                              transactionsData[key].transactions.length &&
                              transactionsData[key].transactions[0].tradeGroupId ===
                                tradeGroupId &&
                Severity: Major
                Found in src/modules/notifications/actions/notifications.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                    if (
                      type === SCALAR &&
                      (!minPrice ||
                        (!BigNumber.isBigNumber(minPrice) && isNaN(minPrice)) ||
                        !maxPrice ||
                  Severity: Major
                  Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (!isEqual(newOrderInfo, currentOrderInfo)) {
                          // trade has changed, lets update trade.
                          this.updateTrade(newStateInfo, nextProps);
                    
                          const nextTradePrice = nextProps.selectedOutcome.trade.limitPrice;
                    Severity: Major
                    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (orderType === LIMIT) {
                            return (
                              <div>
                                <ul className={Styles["TradingForm__form-body"]}>
                                  {!isMobile &&
                      Severity: Major
                      Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                            if (
                              (isConnected !== nextProps.isConnected ||
                                loadingState !== nextProps.loadingState) &&
                              (nextProps.isConnected &&
                                nextProps.loadingState === null &&
                        Severity: Major
                        Found in src/modules/market/components/market-view/market-view.jsx - About 1 hr to fix

                          Function toggleTag has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const toggleTag = (tag, location, history) => () => {
                            let searchParams = parseQuery(location.search);
                          
                            if (
                              searchParams[TAGS_PARAM_NAME] == null ||
                          Severity: Minor
                          Found in src/modules/routes/helpers/toggle-tag.js - About 55 mins 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 default has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export default function(
                            market,
                            disputeStakes,
                            newOutcomeDisputeBond,
                            forkThreshold
                          Severity: Minor
                          Found in src/modules/reports/selectors/select-dispute-outcomes.js - About 55 mins 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 default has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export default function(filterSortOptions = DEFAULT_STATE, { type, data }) {
                            switch (type) {
                              case UPDATE_FILTER_SORT_OPTIONS: {
                                const { optionKey, optionValue } = data;
                                if (optionKey === MARKET_MAX_SPREAD) {
                          Severity: Minor
                          Found in src/modules/filter-sort/reducers/filter-sort-options.js - About 55 mins 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 loadMarketsToReportOn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const loadMarketsToReportOn = (options, callback = logError) => (
                            dispatch,
                            getState
                          ) => {
                            const { env, universe, loginAccount } = getState();
                          Severity: Minor
                          Found in src/modules/reports/actions/load-markets-to-report-on.js - About 55 mins 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 validateAmount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            validateAmount(amount, callback) {
                              const { eth } = this.props;
                              const { selectedAsset, repGasCost, upperBound, etherGasCost } = this.state;
                              let gasValue = etherGasCost.value;
                              if (selectedAsset !== ETH) {
                          Severity: Minor
                          Found in src/modules/account/components/account-withdraw/account-withdraw.jsx - About 55 mins 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 processFavorites has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const processFavorites = (
                            stateFavsIn,
                            storedFavsIn,
                            networkId,
                            universeId
                          Severity: Minor
                          Found in src/modules/markets/helpers/favorites-processor.js - About 55 mins 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 onDerivationPathChange has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            static async onDerivationPathChange(derivationPaths, pageNumber = 1) {
                              const transport = await TransportU2F.create();
                              const ledgerEthereum = new Eth(transport);
                              const appConfiguration = await ledgerEthereum.getAppConfiguration();
                              if (!appConfiguration.arbitraryDataEnabled) {
                          Severity: Minor
                          Found in src/modules/auth/components/ledger-connect/ledger-connect.jsx - About 55 mins 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 orderAndAssignCumulativeShares has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            (orderBook, userOpenOrders, loginAccount) => {
                              const rawBids = ((orderBook || {})[BIDS] || []).slice();
                              const bids = rawBids.sort((a, b) => b.price.value - a.price.value).reduce(
                                (p, order, i, orders) => [
                                  ...p,
                          Severity: Minor
                          Found in src/modules/markets/helpers/order-and-assign-cumulative-shares.js - About 55 mins 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

                          Severity
                          Category
                          Status
                          Source
                          Language