AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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

export default function(marketsData = DEFAULT_STATE, action) {
  switch (action.type) {
    case UPDATE_MARKETS_DATA: // TODO -- allow for the consumption of partial market objects
      return {
        ...marketsData,
Severity: Minor
Found in src/modules/markets/reducers/markets-data.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 orderValidation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  orderValidation(order, nextProps = null) {
    let errors = {
      [this.INPUT_TYPES.QUANTITY]: [],
      [this.INPUT_TYPES.PRICE]: [],
      [this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
Severity: Minor
Found in src/modules/trading/components/trading--form/trading--form.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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

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 processEndTime has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  static processEndTime(newMarket) {
    if (!newMarket.setEndTime) {
      return newMarket.endTime;
    }

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 OutcomeTradingIndicator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export default function OutcomeTradingIndicator({
  tradingIndicator,
  style,
  location,
  isMobile

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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      clearSelectedOutcome,
      description,
      history,
Severity: Minor
Found in src/modules/market/components/market-header/market-header.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

Avoid deeply nested control flow statements.
Open

          if (numOrders) {
            console.log(
              "found open orders:",
              outcome.id,
              outcome.userOpenOrders
Severity: Major
Found in src/modules/orders/actions/cancel-order.js - About 45 mins to fix

    Function consoleLog has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const consoleLog = store => next => action => {
      if (!action) return;
      const isIgnoreFlag = action.meta != null && action.meta.ignore === true;
      if (typeof action !== "function" && !isIgnoreFlag) {
        // console.log(action);
    Severity: Minor
    Found in src/store.js - About 45 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 getUserOpenOrders has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      marketId,
      orders,
      orderType,
      outcomeId,
      userId,
    Severity: Minor
    Found in src/modules/orders/selectors/user-open-orders.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                if (relayTransaction && !isBlacklisted) {
                  dispatch(updateTransactionsData(relayTransaction));
                }
      Severity: Major
      Found in src/modules/transactions/actions/register-transaction-relay.js - About 45 mins to fix

        Function setSelectedUniverse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const setSelectedUniverse = selectedUniverseId => (
          dispatch,
          getState
        ) => {
          const { loginAccount, env, connection } = getState();
        Severity: Minor
        Found in src/modules/auth/actions/selected-universe-management.js - About 45 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 getOutcome has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export function getOutcome(
          market,
          outcome,
          alwaysReturnYesForBinaryMarket = true
        ) {
        Severity: Minor
        Found in src/modules/transactions/actions/add-transactions.js - About 45 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 loadUniverse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const loadUniverse = (universeId, history, callback = logError) => (
          dispatch,
          getState
        ) => {
          const universePayload = { tx: { to: universeId } };
        Severity: Minor
        Found in src/modules/app/actions/load-universe.js - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function() {
          const positionsSummary = generateMarketsPositionsSummary(selectAllMarkets());
          const marketsSummary = selectMarketsSummary();
        
          const totalValue = formatEther(
        Severity: Minor
        Found in src/modules/positions/selectors/portfolio-totals.js - About 45 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 handleMarketCreatedLog has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const handleMarketCreatedLog = log => (dispatch, getState) => {
          const isStoredTransaction =
            log.marketCreator === getState().loginAccount.address;
          if (log.removed) {
            dispatch(removeMarket(log.market));
        Severity: Minor
        Found in src/modules/events/actions/log-handlers.js - About 45 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 defaultLogHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const defaultLogHandler = log => (dispatch, getState) => {
          if (log.transactionHash == null)
            return console.error("transaction hash not found", log);
          augur.rpc.eth.getTransactionByHash(
            [log.transactionHash],
        Severity: Minor
        Found in src/modules/events/actions/default-log-handler.js - About 45 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 8 (exceeds 5 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: Minor
        Found in src/modules/markets/reducers/new-market.js - About 45 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

        Avoid deeply nested control flow statements.
        Open

                      if (
                        transaction.meta &&
                        transaction.meta.txhash === notifications[i].id
                      ) {
                        dispatch(
        Severity: Major
        Found in src/modules/notifications/actions/notifications.js - About 45 mins to fix

          Function calcProtocol has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            calcProtocol(uri) {
              const { types } = this;
              if (typeof uri === "string" && uri.length && uri.includes("://")) {
                if (uri.includes(types.IPC)) return types.IPC;
                if (uri.includes(types.WS)) return types.WS;
          Severity: Minor
          Found in src/modules/modal/components/modal-network-connect.jsx - About 45 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 loadMarketsByFilter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export const loadMarketsByFilter = (filterOptions, cb = () => {}) => (
            dispatch,
            getState
          ) => {
            const { universe } = getState();
          Severity: Minor
          Found in src/modules/markets/actions/load-markets.js - About 45 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