AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

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

export default function(fS) {
  expect(fS).toBeDefined();
  expect(typeof fS).toBe("object");

  const sFS = fS.selectedFilterSort;
Severity: Minor
Found in src/assertions/filter-sort.js - About 1 hr to fix

    Function loginWithMetaMask has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const loginWithMetaMask = (callback = logError) => dispatch => {
      const failure = () => callback("NOT_SIGNED_IN");
      const success = account => {
        // make sure we actually have an account before succeeding...
        if (!account) return failure();
    Severity: Minor
    Found in src/modules/auth/actions/login-with-metamask.js - About 1 hr to fix

      Function selectTransactions has 29 lines of code (exceeds 25 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

        Function loadUnclaimedFees has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const loadUnclaimedFees = (marketIds = [], callback = logError) => (
          dispatch,
          getState
        ) => {
          if (marketIds == null || marketIds.length === 0) return callback(null, []);
        Severity: Minor
        Found in src/modules/markets/actions/market-creator-fees-management.js - About 1 hr to fix

          Function getOrderBookKeys has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const getOrderBookKeys = memoize((marketDepth, minPrice, maxPrice) => {
            let min = marketDepth[BIDS].reduce((p, order, i) => {
              if (i === 0) return order[1];
              return order[1] < p ? order[1] : p;
            }, null);
          Severity: Minor
          Found in src/modules/markets/helpers/get-orderbook-keys.js - About 1 hr to fix

            Function AccountView has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const AccountView = p => {
              const showRepFaucet = parseInt(augur.rpc.getNetworkID(), 10) !== 1;
            
              return (
                <section className={Styles.AccountView}>
            Severity: Minor
            Found in src/modules/account/components/account-view/account-view.jsx - About 1 hr to fix

              Function default has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                numShares,
                limitPrice,
                side,
                minPrice,
                maxPrice,
              Severity: Major
              Found in src/modules/trades/helpers/calc-order-profit-loss-percents.js - About 1 hr to fix

                Function callbackTests has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const callbackTests = asset => {
                      t.asset = asset;
                
                      beforeEach(() => {
                        updateLoginAccountSpy = jest
                Severity: Minor
                Found in src/modules/auth/actions/update-assets.test.js - About 1 hr to fix

                  Function ledgerSigner has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ledgerSigner = async (rawTxArgs, ledgerLib, derivationPath, dispatch) => {
                    dispatch(
                      updateModal({
                        type: MODAL_LEDGER
                      })
                  Severity: Minor
                  Found in src/modules/auth/helpers/ledger-signer.js - About 1 hr to fix

                    Function addNewMarketCreationTransactions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function addNewMarketCreationTransactions(market) {
                      return (dispatch, getState) => {
                        const marketCreationData = {};
                        const { loginAccount } = getState();
                        const transaction = {
                    Severity: Minor
                    Found in src/modules/transactions/actions/add-transactions.js - About 1 hr to fix

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

                        componentWillMount() {
                          const ClaimReportingFeesForkedMarketOptions = {
                            forkedMarket: this.props.forkedMarket,
                            estimateGas: true,
                            onSent: () => {},

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

                          constructor(props) {
                            super(props);
                        
                            const etherGasCost = formatEtherEstimate(
                              formatGasCostToEther(

                          Function selectBucketedPriceTimeSeries has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const selectBucketedPriceTimeSeries = (
                            creationTime,
                            currentTimestamp,
                            outcomes
                          ) => {
                          Severity: Minor
                          Found in src/modules/markets/selectors/select-bucketed-price-time-series.js - About 1 hr to fix

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

                            export default function() {
                              const positionsSummary = generateMarketsPositionsSummary(selectAllMarkets());
                              const marketsSummary = selectMarketsSummary();
                            
                              const totalValue = formatEther(
                            Severity: Minor
                            Found in src/modules/positions/selectors/portfolio-totals.js - About 1 hr to fix

                              Function wrapLogHandler has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              ) => (err, log) => {
                                if (err) return console.error((log || {}).eventName, err, log);
                                if (log) {
                                  // console.info(`${new Date().toISOString()} LOG ${log.removed ? 'REMOVED' : 'ADDED'} ${log.eventName} ${JSON.stringify(log)}`)
                                  const universeId = getState().universe.id;
                              Severity: Minor
                              Found in src/modules/events/actions/wrap-log-handler.js - About 1 hr to fix

                                Function buildSearchString has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const buildSearchString = (keywords, tags) => {
                                  const MIN_KEYWORDS_LENGTH = 1;
                                  const propertyTranslation = [
                                    { find: "title:", replace: "shortDescription:" },
                                    { find: "details:", replace: "longDescription:" },
                                Severity: Minor
                                Found in src/modules/markets/selectors/build-search-string.js - About 1 hr to fix

                                  Function selectInfoNotificationsAndSeenCount has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    notifications => {
                                      const networkId = augur.rpc.getNetworkID();
                                      const { universe } = store.getState();
                                  
                                      let filteredNotifications = notifications;
                                  Severity: Minor
                                  Found in src/modules/notifications/selectors/notifications.js - About 1 hr to fix

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

                                      render() {
                                        const {
                                          fixedPrecision,
                                          pricePrecision,
                                          hoveredDepth,

                                      Function testPrice has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        testPrice(value, errors, isOrderValid, nextProps = null) {
                                          const props = nextProps || this.props;
                                          const { maxPrice, minPrice, market } = props;
                                          const tickSize = createBigNumber(market.tickSize);
                                          let errorCount = 0;
                                      Severity: Minor
                                      Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                                        Function useUnlockedAccount has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        export const useUnlockedAccount = (
                                          unlockedAddress,
                                          callback = logError
                                        ) => dispatch => {
                                          if (unlockedAddress == null) return callback("no account address");
                                        Severity: Minor
                                        Found in src/modules/auth/actions/use-unlocked-account.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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language