AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

Consider simplifying this complex logical expression.
Open

    if (
      !isEqual(hoveredPrice, nextProps.hoveredPrice) ||
      !isEqual(marketDepth, nextProps.marketDepth) ||
      !isEqual(this.state.yScale, nextState.yScale) ||
      !isEqual(this.state.xScale, nextState.xScale) ||

    Function loadMarketsToReportOn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const loadMarketsToReportOn = (options, callback = logError) => (
      dispatch,
      getState
    ) => {
      const { env, universe, loginAccount } = getState();
    Severity: Minor
    Found in src/modules/reports/actions/load-markets-to-report-on.js - About 1 hr to fix

      Function updateAssets has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

          componentWillReceiveProps(nextProps) {
            const { selectedOrderProperties } = this.props;
        
            if (!nextProps.selectedOutcome || !nextProps.selectedOutcome.trade) {
              this.setState({ currentPage: 0 });

          Function setAccountDisputeData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            setAccountDisputeData(accountDisputeData) {
              const { stakeInfo, updateState } = this.props;
              if (stakeInfo && createBigNumber(stakeInfo.repValue).gt(ZERO)) {
                delete accountDisputeData.validations.stake;
              }

            Function verifyLiquidity has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function verifyLiquidity(
              orders: Array<LiquidityOrder>,
              timeoutMilliseconds = 10000
            ) {
              for (let i = 0; i < orders.length; i++) {
            Severity: Minor
            Found in integration/helpers/liquidity.ts - About 1 hr to fix

              Function validateOutcomes has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                validateOutcomes(value, index) {
                  const { isValid, newMarket, updateNewMarket } = this.props;
                  const { currentStep } = newMarket;
              
                  const updatedMarket = { ...newMarket };

                Function processReport has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function processReport(market, transaction) {
                  const amountStaked = formatAttoRep(transaction.amountStaked, {
                    decimals: 4,
                    roundUp: true
                  });
                Severity: Minor
                Found in src/modules/transactions/actions/add-transactions.js - About 1 hr to fix

                  Function addCompleteSetsSoldLogs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function addCompleteSetsSoldLogs(completeSetsSoldLogs) {
                    return (dispatch, getState) => {
                      const { marketsData } = getState();
                      const completeSetsData = {};
                      each(completeSetsSoldLogs, completeSetLog => {
                  Severity: Minor
                  Found in src/modules/transactions/actions/add-transactions.js - About 1 hr to fix

                    Function validateAmount has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      validateAmount(amount, callback) {
                        const { eth } = this.props;
                        const { selectedAsset, repGasCost, upperBound, etherGasCost } = this.state;
                        let gasValue = etherGasCost.value;
                        if (selectedAsset !== ETH) {

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

                        componentWillUpdate(nextProps, nextState) {
                          const { isLoading, isClicked, showAdvanced } = this.props;
                          if (
                            nextState.walletAddresses !== this.state.walletAddresses &&
                            !nextState.walletAddresses.every(element => !element)
                      Severity: Minor
                      Found in src/modules/auth/components/common/hardware-wallet.jsx - About 1 hr to fix

                        Function mergeProps has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const mergeProps = (sP, dP, oP) => {
                          const marketId = parseQuery(oP.location.search)[MARKET_ID_PARAM_NAME];
                          const market = selectMarket(marketId);
                        
                          return {
                        Severity: Minor
                        Found in src/modules/forking/containers/migrate-rep.js - About 1 hr to fix

                          Function mapStateToProps has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const mapStateToProps = (state, ownProps) => {
                            const {
                              creationTime = {},
                              maxPrice = createBigNumber(1),
                              minPrice = createBigNumber(0),
                          Severity: Minor
                          Found in src/modules/market-charts/containers/market-outcomes-chart.js - About 1 hr to fix

                            Function sellCompleteSets has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function sellCompleteSets(
                              marketId,
                              numCompleteSets,
                              callback = logError
                            ) {
                            Severity: Minor
                            Found in src/modules/positions/actions/sell-complete-sets.js - About 1 hr to fix

                              Function createYesNoMarket has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const createYesNoMarket = async (
                                address: string = "",
                                settlementFee: number = 0
                              ) => {
                                // page.on('console', msg => console.log('PAGE LOG:', msg.text()));
                              Severity: Minor
                              Found in integration/helpers/create-markets.ts - About 1 hr to fix

                                Function selectTransactions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  transactionsData => {
                                    const tradeGroups = [];
                                    const formattedTransactions = Object.keys(transactionsData || {})
                                      .reduce((p, id) => {
                                        const { tradeGroupId } = transactionsData[id];
                                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 componentWillReceiveProps has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  componentWillReceiveProps(nextProps) {
                                    const { isMobile, location, universe, blockchain } = this.props;
                                    if (isMobile !== nextProps.isMobile) {
                                      this.setState({
                                        mobileMenuState: mobileMenuStates.CLOSED
                                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 toggleMenuTween has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  toggleMenuTween(menuKey, forceOpen, cb) {
                                    if (getValue(this.state[menuKey], "currentTween.stop"))
                                      this.state[menuKey].currentTween.stop();
                                
                                    let nowOpen = !this.state[menuKey].open;
                                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 componentWillUpdate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  componentWillUpdate(nextProps, nextState) {
                                    const { isLoading, isClicked, showAdvanced } = this.props;
                                    if (
                                      nextState.walletAddresses !== this.state.walletAddresses &&
                                      !nextState.walletAddresses.every(element => !element)
                                Severity: Minor
                                Found in src/modules/auth/components/common/hardware-wallet.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 determineDrawParams has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function determineDrawParams(options) {
                                  const {
                                    sharedChartMargins,
                                    depthChart,
                                    marketDepth,

                                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