AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

export default function(reportableOutcomes, forkMigrationTotals) {
  const invalidMarketId = "0.5";
  const topOutcomes = 8;

  if (
Severity: Major
Found in src/modules/reports/selectors/select-migrated-totals.js - About 2 hrs to fix

    Function default has 66 lines of code (exceeds 25 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: Major
    Found in src/modules/markets/reducers/markets-data.js - About 2 hrs to fix

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

        render() {
          const {
            doesUserHaveRep,
            forkEndTime,
            history,

        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,

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                            banana: [
                              {
                                quantity: "2",
                                price: "0.5",
                                type: "bid",
                    Severity: Major
                    Found in src/modules/orders/reducers/liquidity-orders.test.js and 1 other location - About 2 hrs to fix
                    src/modules/orders/reducers/liquidity-orders.test.js on lines 275..297

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 87.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                  <li
                                    className={classNames({
                                      [`${Styles.active_sell}`]: s.selectedNav === SELL
                                    })}
                                  >
                    src/modules/trading/components/trading--wrapper/trading--wrapper.jsx on lines 239..247

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 87.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                              banana: [
                                {
                                  quantity: "2",
                                  price: "0.5",
                                  type: "bid",
                    Severity: Major
                    Found in src/modules/orders/reducers/liquidity-orders.test.js and 1 other location - About 2 hrs to fix
                    src/modules/orders/reducers/liquidity-orders.test.js on lines 305..327

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 87.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                  <li
                                    className={classNames({
                                      [`${Styles.active_buy}`]: s.selectedNav === BUY
                                    })}
                                  >
                    src/modules/trading/components/trading--wrapper/trading--wrapper.jsx on lines 248..256

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 87.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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";

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                "0xTRANS4": {
                                  data: {
                                    id: "0xMARKETID",
                                    outcomeName: "test outcome"
                                  },
                        Severity: Major
                        Found in src/modules/transactions/selectors/transactions.test.js and 2 other locations - About 2 hrs to fix
                        src/modules/transactions/selectors/transactions.test.js on lines 43..58
                        src/modules/transactions/selectors/transactions.test.js on lines 106..121

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 86.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                "0xTRANS5": {
                                  data: {
                                    id: "0xMARKETID",
                                    outcomeName: "test outcome"
                                  },
                        Severity: Major
                        Found in src/modules/transactions/selectors/transactions.test.js and 2 other locations - About 2 hrs to fix
                        src/modules/transactions/selectors/transactions.test.js on lines 43..58
                        src/modules/transactions/selectors/transactions.test.js on lines 90..105

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 86.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                "0xTRANS1": {
                                  data: {
                                    id: "0xMARKETID",
                                    outcomeName: "test outcome"
                                  },
                        Severity: Major
                        Found in src/modules/transactions/selectors/transactions.test.js and 2 other locations - About 2 hrs to fix
                        src/modules/transactions/selectors/transactions.test.js on lines 90..105
                        src/modules/transactions/selectors/transactions.test.js on lines 106..121

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 86.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              transactionTypeOptions: [
                                { label: "All", value: ALL },
                                { label: "Trades", value: TRADE },
                                { label: "Orders", value: OPEN_ORDER },
                                { label: "Transfers", value: TRANSFER },
                        src/modules/filter-sort/components/filter-dropdowns/filter-dropdowns.jsx on lines 64..72

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 86.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language