AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

File icons.jsx has 1783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from "react";

export const AlertIcon = (
  <svg
    width="20"
Severity: Major
Found in src/modules/common/components/icons.jsx - About 4 days to fix

    File update-trades-in-progress.test.js has 949 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import configureMockStore from "redux-mock-store";
    import thunk from "redux-thunk";
    import testState from "test/testState";
    import { BUY, SELL, tradeTestState } from "test/tradeTestState";
    import { loadUsershareBalances } from "modules/positions/actions/load-user-share-balances";
    Severity: Major
    Found in src/modules/trades/actions/update-trades-in-progress.test.js - About 2 days to fix

      File create-market.test.ts has 930 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      "use strict";
      
      import "jest-environment-puppeteer";
      import Flash from "./helpers/flash";
      import { IFlash, IMarket, MarketCosts } from "./types/types";
      Severity: Major
      Found in integration/create-market.test.ts - About 2 days to fix

        Function setNotificationText has 445 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function setNotificationText(notification, callback) {
          return (dispatch, getState) => {
            if (!notification || isEmpty(notification)) {
              return dispatch(callback(notification));
            }
        Severity: Major
        Found in src/modules/notifications/actions/set-notification-text.js - About 2 days to fix

          Function assembleMarket has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
          Open

          export function assembleMarket(
            marketId,
            marketData,
            marketLoading,
            marketPriceHistory,
          Severity: Minor
          Found in src/modules/markets/selectors/market.js - About 2 days 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 376 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const {
                currentTimestamp,
                isMobile,
                linkType,

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

            export default function(market) {
              // market can be undefined
              if (!market.id) {
                return;
              }
            Severity: Major
            Found in src/assertions/market.js - About 1 day to fix

              Function assembleMarket has 354 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function assembleMarket(
                marketId,
                marketData,
                marketLoading,
                marketPriceHistory,
              Severity: Major
              Found in src/modules/markets/selectors/market.js - About 1 day to fix

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

                  render() {
                    const {
                      currentTime,
                      forkEndTime,
                      forkingMarket,

                  File select-dispute-outcomes.test.js has 732 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import sinon from "sinon";
                  import {
                    CATEGORICAL,
                    SCALAR,
                    YES_NO
                  Severity: Major
                  Found in src/modules/reports/selectors/select-dispute-outcomes.test.js - About 1 day to fix

                    File create-market-form-liquidity.jsx has 704 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint jsx-a11y/label-has-for: 0 */
                    /* eslint react/no-array-index-key: 0 */
                    
                    import React, { Component } from "react";
                    import PropTypes from "prop-types";

                      Function marketId has 322 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            (
                              marketId,
                              marketData,
                              marketLoading,
                              marketPriceHistory,
                      Severity: Major
                      Found in src/modules/markets/selectors/market.js - About 1 day to fix

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

                          render() {
                            const {
                              market,
                              currentTimestamp,
                              tentativeWinner,
                        Severity: Major
                        Found in src/modules/market/components/core-properties/core-properties.jsx - About 1 day to fix

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

                            render() {
                              const {
                                newMarket,
                                validateField,
                                keyPressed,

                            File market-outcome-charts--candlestick.jsx has 665 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React from "react";
                            import PropTypes from "prop-types";
                            import CustomPropTypes from "utils/custom-prop-types";
                            import * as d3 from "d3";
                            import ReactFauxDOM from "react-faux-dom";

                              File app.jsx has 640 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              // TODO -- this component needs to be broken up
                              //         all logic related to sidebar(s) need to be housed w/in a separate component
                              
                              import React, { Component } from "react";
                              import PropTypes from "prop-types";
                              Severity: Major
                              Found in src/modules/app/components/app/app.jsx - About 1 day to fix

                                File market-outcome-charts--depth.jsx has 639 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import React, { Component } from "react";
                                import PropTypes from "prop-types";
                                import * as d3 from "d3";
                                import ReactFauxDOM from "react-faux-dom";
                                
                                

                                  File trading--form.jsx has 624 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /* eslint jsx-a11y/label-has-for: 0 */
                                  import { augur } from "services/augurjs";
                                  import React, { Component } from "react";
                                  import PropTypes from "prop-types";
                                  import classNames from "classnames";
                                  Severity: Major
                                  Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 day to fix

                                    File reporting-dispute-form.jsx has 621 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    /* eslint jsx-a11y/label-has-for: 0 */
                                    
                                    import React, { Component } from "react";
                                    import PropTypes from "prop-types";
                                    import classNames from "classnames";

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

                                        render() {
                                          const {
                                            isMobile,
                                            market,
                                            marketQuantity,
                                      Severity: Major
                                      Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 day to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language