AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

Function orderForMarketDepth has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const orderForMarketDepth = orderBook => {
  const rawBids = ((orderBook || {})[BIDS] || []).slice();
  const bids = rawBids.reduce(
    (p, order) => [
      ...p,
Severity: Minor
Found in src/modules/markets/helpers/order-for-market-depth.js - About 1 hr to fix

    Function submitNewMarket has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function submitNewMarket(newMarket, history, callback = noop) {
      return (dispatch, getState) => {
        const { universe, loginAccount, contractAddresses } = getState();
        const { createMarket, formattedNewMarket } = buildCreateMarket(
          newMarket,
    Severity: Minor
    Found in src/modules/markets/actions/submit-new-market.js - About 1 hr to fix

      Function createReducer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function createReducer() {
        return {
          accountDisputes,
          accountPositions,
          accountTrades,
      Severity: Minor
      Found in src/reducers.js - About 1 hr to fix

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

          constructor(props) {
            super(props);
        
            let selectedOutcome = props.newMarket.type === CATEGORICAL ? "" : 1;
            if (

          Function verifyLiquidityOrderBook has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function verifyLiquidityOrderBook(
            askOrders: LiquidityChartRows,
            bidOrders: LiquidityChartRows,
            timeoutMilliseconds = 10000
          ) {
          Severity: Minor
          Found in integration/helpers/liquidity.ts - About 1 hr to fix

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

            export default function(
              numShares,
              limitPrice,
              side,
              minPrice,
            Severity: Minor
            Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 1 hr 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 handleMarketFinalizedLog has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            export const handleMarketFinalizedLog = log => (dispatch, getState) =>
              dispatch(
                loadMarketsInfo([log.market], err => {
                  if (err) return console.error(err);
                  const { author } = getState().marketsData[log.market];
            Severity: Minor
            Found in src/modules/events/actions/log-handlers.js - About 1 hr 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 calculateMaxPossibleShares has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              (
                loginAccount,
                orders,
                makerFee,
                settlementFee,
            Severity: Minor
            Found in src/modules/markets/helpers/calculate-max-possible-shares.js - About 1 hr 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 15 (exceeds 5 allowed). Consider refactoring.
            Open

              render() {
                const {
                  blockchain,
                  coreStats,
                  history,
            Severity: Minor
            Found in src/modules/app/components/app/app.jsx - About 1 hr 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 drawCrosshairs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              drawCrosshairs(options) {
                const { updateHoveredDepth, sharedChartMargins } = this.props;
                if (this.depthChart) {
                  const {
                    hoveredPrice,

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

            export async function createLiquidity(orders: Array<LiquidityOrder>) {
              let askOrders: LiquidityChartRows = {};
              let bidOrders: LiquidityChartRows = {};
              let currentOrdersArray;
              for (let order of orders) {
            Severity: Minor
            Found in integration/helpers/liquidity.ts - About 1 hr 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 getBulkWalletAddressesWithBalances has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async getBulkWalletAddressesWithBalances(
                paths,
                pageNumber,
                sortAndfilterBalances = true
              ) {
            Severity: Minor
            Found in src/modules/auth/components/common/hardware-wallet.jsx - About 1 hr to fix

              Function selectMarket has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const selectMarket = marketId => {
                const {
                  marketsData,
                  marketLoading,
                  favorites,
              Severity: Minor
              Found in src/modules/markets/selectors/market.js - About 1 hr to fix

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

                  render() {
                    const { isMobile, mobileMenuState, subMenuScalar } = this.props;
                    const showMainMenu = mobileMenuState >= mobileMenuStates.FIRSTMENU_OPEN;
                    const showSubMenu = mobileMenuState === mobileMenuStates.SUBMENU_OPEN;
                
                
                Severity: Minor
                Found in src/modules/app/components/inner-nav/base-inner-nav.jsx - About 1 hr to fix

                  Function buildCreateMarket has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const buildCreateMarket = (
                    newMarket,
                    isEstimate,
                    universe,
                    loginAccount,
                  Severity: Minor
                  Found in src/modules/markets/helpers/build-create-market.js - About 1 hr to fix

                    Function componentWillUpdate has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      componentWillUpdate(nextProps, nextState) {
                        if (this.props.isConnected !== nextProps.isConnected)
                          this.props.loadMarkets();
                        if (
                          this.state.lowerBound !== nextState.lowerBound ||
                    Severity: Minor
                    Found in src/modules/reporting/components/common/disputing-markets.jsx - About 1 hr to fix

                      Function validateStake has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        validateStake(rawStakeObj) {
                          const { updateState } = this.props;
                          const updatedValidations = { ...this.state.validations };
                          let completeStakeObj = rawStakeObj;
                          const maxInfo = this.calculateMaxRep(this.state.selectedOutcome);

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

                        export default function(authForm) {
                          expect(authForm).toBeDefined();
                          expect(typeof authForm).toBe("object");
                        
                          expect(authForm.closeLink).toBeDefined();
                        Severity: Minor
                        Found in src/assertions/auth-form.js - About 1 hr to fix

                          Function assertAccountReport has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function assertAccountReport(report) {
                            describe(`report's shape`, () => {
                              test("id", () => {
                                expect(report.id).toBeDefined();
                                expect(typeof report.id).toBe("string");
                          Severity: Minor
                          Found in src/assertions/my-reports.js - About 1 hr to fix

                            Function mousemove has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function mousemove() {
                                  const { data } = selectedSeriesData[0];
                                  const v2 = x.invert(d3.mouse(this)[0]);
                                  const biSect = d3.bisector(d => d[0]).left;
                                  let i = biSect(data, v2, 0);
                              Severity
                              Category
                              Status
                              Source
                              Language