AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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

  componentWillReceiveProps(nextProps) {
    const {
      orderEthEstimate,
      orderShareEstimate,
      selectedNav,
Severity: Minor
Found in src/modules/trading/components/trading--form/trading--form.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 updateTrade has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  updateTrade(updatedState, propsToUse) {
    let { props } = this;
    if (propsToUse) props = propsToUse;
    const side = props.selectedNav;
    let limitPrice = updatedState[this.INPUT_TYPES.PRICE];
Severity: Minor
Found in src/modules/trading/components/trading--form/trading--form.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 constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(props) {
    super(props);

    this.state = {
      outcomes: [],

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

const MarketBasics = ({
  category,
  tags = [],
  location,
  history,
Severity: Minor
Found in src/modules/market/components/market-basics/market-basics.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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      isExtendedDisplay,
      isMobile,
      outcomeName,

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

Consider simplifying this complex logical expression.
Open

  if (
    oldUniverseData.id !== universeData.id ||
    oldUniverseData.isForking !== universeData.isForking ||
    oldUniverseData.forkingMarket !== universeData.forkingMarket ||
    oldUniverseData.forkEndTime !== universeData.forkEndTime ||
Severity: Major
Found in src/modules/universe/actions/load-universe-info.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

      if (
        order &&
        !isNaN(order.fullPrecisionPrice) &&
        !isNaN(order.fullPrecisionAmount)
      ) {
    Severity: Major
    Found in src/modules/orders/helpers/select-order-book.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

        if (
          !numShares ||
          !sharesFilled ||
          !side ||
          !type ||
      Severity: Major
      Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                  if (
                    notification.log &&
                    notifications[index].log &&
                    notification.log.eventName !== notifications[index].log.eventName &&
                    notifications[index].log.orderId &&
        Severity: Major
        Found in src/modules/notifications/actions/notifications.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

            if (meta.status === "Open" || meta.status === "Canceled") {
              return (
                <div className={Styles.TransactionMetaContainer}>
                  <ul className={Styles.TransactionMeta}>
                    {Object.keys(meta)
          Severity: Major
          Found in src/modules/portfolio/components/transaction-meta/transaction-meta.jsx - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  (isNaN(reportingFees.unclaimedEth.value) ||
                    reportingFees.unclaimedEth.formatted === "-" ||
                    reportingFees.unclaimedEth.formatted === "") &&
                  (isNaN(reportingFees.unclaimedRep.value) ||
            Severity: Major
            Found in src/modules/portfolio/components/portfolio-reports/portfolio-reports.jsx - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if (
                    newMarket.type !== nextProps.newMarket.type ||
                    newMarket.scalarSmallNum !== nextProps.newMarket.scalarSmallNum ||
                    newMarket.scalarBigNum !== nextProps.newMarket.scalarBigNum ||
                    newMarket.orderBookSorted !== nextProps.newMarket.orderBookSorted ||

                Function getUniversesInfoWithParentContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  account,
                  currentUniverseData,
                  parentUniverseData,
                  grandParentUniverseData,
                  callback
                Severity: Minor
                Found in src/modules/universe/actions/load-universe-info.js - About 35 mins to fix

                  Function default has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    orderId,
                    marketId,
                    outcome,
                    orderTypeLabel,
                    orderBooks
                  Severity: Minor
                  Found in src/modules/orders/selectors/select-order.js - About 35 mins to fix

                    Function formatTransactionFillMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function formatTransactionFillMessage(txType, amount, price, numTxs, outcome) {
                    Severity: Minor
                    Found in src/modules/transactions/actions/add-transactions.js - About 35 mins to fix

                      Function warnNonExistingOrder has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        orderId,
                        status,
                        marketId,
                        outcome,
                        orderTypeLabel
                      Severity: Minor
                      Found in src/modules/orders/actions/update-order-status.js - About 35 mins to fix

                        Function editEndpointParams has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const editEndpointParams = (
                          windowRef,
                          { augurNode, ethereumNodeHTTP, ethereumNodeWS }
                        ) => {
                          const existingParams = parseQuery(windowRef.location.search);
                        Severity: Minor
                        Found in src/utils/edit-endpoint-params.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function(reports = DEFAULT_STATE, { type, data }) {
                          switch (type) {
                            case UPDATE_REPORTS: {
                              const { reportsData } = data;
                              const updatedReports = { ...reports };
                        Severity: Minor
                        Found in src/modules/reports/reducers/reports.js - About 35 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 isShallowUnEqual has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function isShallowUnEqual(obj1, obj2, log) {
                          // both arguments reference the same object
                          if (obj1 === obj2) {
                            return false;
                          }
                        Severity: Minor
                        Found in src/utils/should-component-update-pure.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function(reportableOutcomes, forkMigrationTotals) {
                          const invalidMarketId = "0.5";
                          const topOutcomes = 8;
                        
                          if (
                        Severity: Minor
                        Found in src/modules/reports/selectors/select-migrated-totals.js - About 35 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