AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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

  render() {
    const { className, label, options } = this.props;
    const s = this.state;

    return (
Severity: Major
Found in src/modules/common/components/input-dropdown/input-dropdown.jsx - About 2 hrs to fix

    Function validateScalar has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      validateScalar(value, humanName, min, max, tickSize, isInvalid) {
        const { stakeInfo, updateState } = this.props;
        const updatedValidations = { ...this.state.validations };
    
        if (value === "") {

      Function formatDate has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function formatDate(d) {
        const date = d instanceof Date ? d : new Date(0);
      
        // UTC Time Formatting
        const utcTime = [date.getUTCHours(), date.getUTCMinutes()];
      Severity: Major
      Found in src/utils/format-date.js - About 2 hrs to fix

        Function collectMarketCreatorFees has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ) => (dispatch, getState) => {
          const { loginAccount } = getState();
          if (!loginAccount.address) return callback(null);
          augur.api.Market.getMarketCreatorMailbox(
            { tx: { to: marketId } },
        Severity: Major
        Found in src/modules/markets/actions/market-creator-fees-management.js - About 2 hrs to fix

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

            render() {
              const {
                recipient,
                unclaimedRep,
                unclaimedEth,

            Function listenToUpdates has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const listenToUpdates = history => (dispatch, getState) => {
              if (!selectUseWebsocketToConnectAugurNode(getState())) return;
            
              augur.events.stopBlockListeners();
              augur.events.stopAugurNodeEventListeners();
            Severity: Major
            Found in src/modules/events/actions/listen-to-updates.js - About 2 hrs to fix

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

                render() {
                  const {
                    recipient,
                    unclaimedRep,
                    unclaimedEth,

                File disputing-markets.jsx has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { Component } from "react";
                import PropTypes from "prop-types";
                
                import NullStateMessage from "modules/common/components/null-state-message/null-state-message";
                import DisputeMarketCard from "modules/reporting/components/dispute-market-card/dispute-market-card";
                Severity: Minor
                Found in src/modules/reporting/components/common/disputing-markets.jsx - About 2 hrs to fix

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

                    render() {
                      const p = this.props;
                      const s = this.state;
                  
                      return (
                  Severity: Major
                  Found in src/modules/market/components/market-preview/market-preview.jsx - About 2 hrs to fix

                    Function addTransferTransactions has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function addTransferTransactions(transfers) {
                      return dispatch => {
                        const transactions = {};
                        each(transfers, transfer => {
                          const transaction = { ...transfer };
                    Severity: Major
                    Found in src/modules/transactions/actions/add-transactions.js - About 2 hrs to fix

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

                      export default function(
                        numShares,
                        limitPrice,
                        side,
                        minPrice,
                      Severity: Major
                      Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 2 hrs to fix

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

                          componentWillMount() {
                            const {
                              augurNode,
                              env,
                              ethereumNodeHttp,
                        Severity: Major
                        Found in src/modules/app/components/app/app.jsx - About 2 hrs to fix

                          Function MarketTradingConfirm has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const MarketTradingConfirm = ({
                            trade,
                            isMobile,
                            orderType,
                            selectedNav,
                          Severity: Minor
                          Found in src/modules/trading/components/trading--confirm/trading--confirm.jsx - 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 constructTransaction has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const constructTransaction = (log, callback = logError) => (
                            dispatch,
                            getState
                          ) => {
                            switch (log.eventName) {
                          Severity: Major
                          Found in src/modules/transactions/actions/construct-transaction.js - About 2 hrs to fix

                            Function loadAccountPositions has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const loadAccountPositions = (options = {}, callback = logError) => (
                              dispatch,
                              getState
                            ) => {
                              const { universe, loginAccount } = getState();
                            Severity: Major
                            Found in src/modules/positions/actions/load-account-positions.js - About 2 hrs to fix

                              Function drawLines has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function drawLines(options) {
                                const { drawParams, depthChart, marketDepth, hasOrders } = options;
                              
                                // Defs
                                const chartDefs = depthChart.append("defs");

                                Function drawChart has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  drawChart({
                                    creationTime,
                                    currentTimestamp,
                                    estimatedInitialPrice,
                                    maxPrice,

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

                                    render() {
                                      const {
                                        history,
                                        isLogged,
                                        isMobile,
                                  Severity: Major
                                  Found in src/modules/markets-list/components/markets-view.jsx - About 2 hrs to fix

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

                                      render() {
                                        const { outcomes, isMobileSmall } = this.props;
                                        const totalOutcomes = outcomes.length;
                                    
                                        const numOutcomesToShow = isMobileSmall ? 2 : 3;

                                      Function drawCrosshairs has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        drawCrosshairs(options) {
                                          const { updateHoveredDepth, sharedChartMargins } = this.props;
                                          if (this.depthChart) {
                                            const {
                                              hoveredPrice,
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language