AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

Function onDerivationPathChange has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static async onDerivationPathChange(derivationPaths, pageNumber = 1) {
    const paths = [];

    derivationPaths.forEach(derivationPath => {
      const components = DerivationPath.parse(derivationPath);
Severity: Minor
Found in src/modules/auth/components/trezor-connect/trezor-connect.jsx - About 1 hr to fix

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

      render() {
        const { modal } = this.props;
        const s = this.state;
        const connectionStatus = getValue(this.props, "modal.connection");
        let nodeTitleText = "";
    Severity: Minor
    Found in src/modules/modal/components/modal-network-disconnected.jsx - About 1 hr to fix

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

        constructor(props) {
          super(props);
          // NOTE: from here to this.state was added to sort markets, this might need to be more robust in the future.
          const openMarkets = [];
          const reportingMarkets = [];
      Severity: Minor
      Found in src/modules/portfolio/components/markets/markets.jsx - About 1 hr to fix

        Function loadAccount has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function loadAccount(dispatch, existing, accountType, callback) {
          let loggedInAccount = null;
          const usingMetaMask = accountType === ACCOUNT_TYPES.META_MASK;
          if (windowRef.localStorage && windowRef.localStorage.getItem) {
            loggedInAccount = windowRef.localStorage.getItem("loggedInAccount");
        Severity: Minor
        Found in src/modules/app/actions/init-augur.js - About 1 hr to fix

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

          export default function(callback = logError) {
            return (dispatch, getState) => {
              const { universe, loginAccount } = getState();
              const universeID = universe.id || UNIVERSE_ID;
          
          
          Severity: Minor
          Found in src/modules/account/actions/get-rep.js - About 1 hr to fix

            Function validateForm has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              validateForm(property, rawValue) {
                const { updateState } = this.props;
                // since the order changed by user action, make sure we can place orders.
                // updateState('doNotCreateOrders', false)
                let value = rawValue;
            Severity: Minor
            Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

              Function validateNumber has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                validateNumber(
                  fieldName,
                  rawValue,
                  humanName,
                  min,

                Function componentWillMount has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  componentWillMount() {
                    const {
                      feeWindows,
                      forkedMarket,
                      nonforkedMarkets,

                  Function getMainMenuData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getMainMenuData() {
                      const showRepFaucet = parseInt(augur.rpc.getNetworkID(), 10) !== 1;
                      const { currentBasePath } = this.props;
                      return [
                        {
                  Severity: Minor
                  Found in src/modules/app/components/inner-nav/account-inner-nav.jsx - About 1 hr to fix

                    Function componentWillReceiveProps has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      componentWillReceiveProps(nextProps) {
                        const openMarkets = [];
                        const reportingMarkets = [];
                        const disputingMarkets = [];
                        const finalMarkets = [];
                    Severity: Minor
                    Found in src/modules/portfolio/components/markets/markets.jsx - About 1 hr to fix

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

                        render() {
                          const { children } = this.props;
                          if (this.state.hasError) {
                            return (
                              <section className={Styles.MainErrorBoundary}>

                        Function getDerivedStateFromProps has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          static getDerivedStateFromProps(nextProps, prevState) {
                            const {
                              currentTimeInSeconds,
                              pricePrecision,
                              marketMax,

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

                            constructor(props) {
                              super(props);
                          
                              this.INPUT_TYPES = {
                                QUANTITY: "orderQuantity",
                          Severity: Minor
                          Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

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

                              render() {
                                const {
                                  filter,
                                  sort,
                                  maxFee,

                              Function formatGroupedTransactions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function formatGroupedTransactions(transactions) {
                                const formattedTransactions = transactions
                                  .map(transaction => formatTransaction(transaction))
                                  .sort(
                                    (a, b) =>
                              Severity: Minor
                              Found in src/modules/transactions/selectors/transactions.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 selectTopAsk has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                (marketOrderBook, excludeCurrentUser) => {
                                  let topAsk;
                                  if (excludeCurrentUser) {
                                    const numAsks = marketOrderBook.asks.length;
                                    if (numAsks) {
                              Severity: Minor
                              Found in src/modules/orders/helpers/select-order-book.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 selectTopBid has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                (marketOrderBook, excludeCurrentUser) => {
                                  let topBid;
                                  if (excludeCurrentUser) {
                                    const numBids = marketOrderBook.bids.length;
                                    if (numBids) {
                              Severity: Minor
                              Found in src/modules/orders/helpers/select-order-book.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 getTradeStatus has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function getTradeStatus(
                                marketTradingHistory,
                                marketId,
                                outcomeId,
                                getTradeType

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

                              const MarketOutcomeCandlestickHeader = ({
                                outcomeName,
                                isMobile,
                                volume,
                                fixedPrecision,

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

                                validateType(value) {
                                  const { isValid, newMarket, updateNewMarket } = this.props;
                                  const updatedMarket = { ...newMarket };
                                  const validations = updatedMarket.validations[newMarket.currentStep];
                              
                              

                              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