AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function loadReportingFinal has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const loadReportingFinal = (callback = logError) => (
  dispatch,
  getState
) => {
  const { universe } = getState();
Severity: Minor
Found in src/modules/reports/actions/load-reporting-final.js - About 1 hr to fix

    Function constructRelayTransaction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const constructRelayTransaction = tx => (dispatch, getState) => {
      const { notifications } = getState();
      const { hash, status } = tx;
      const unpackedParams = unpackTransactionParameters(tx);
      const timestamp =
    Severity: Minor
    Found in src/modules/transactions/actions/construct-relay-transaction.js - About 1 hr to fix

      Function sortOrders has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function sortOrders(orderBook) {
        const sortedOrderBook = {};
        const bids = [];
        const asks = [];
        Object.keys(orderBook).forEach(outcome => {
      Severity: Minor
      Found in src/modules/orders/helpers/liquidity.js - About 1 hr to fix

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

        const mapStateToProps = (state, ownProps) => {
          const market = selectMarket(ownProps.marketId);
          const userOrders =
            state.orderBooks[ownProps.marketId] &&
            state.orderBooks[ownProps.marketId][ownProps.selectedOutcome];
        Severity: Minor
        Found in src/modules/market-charts/containers/market-outcome-charts.js - About 1 hr to fix

          Function processFavorites has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const processFavorites = (
            stateFavsIn,
            storedFavsIn,
            networkId,
            universeId
          Severity: Minor
          Found in src/modules/markets/helpers/favorites-processor.js - About 1 hr to fix

            Function getUniverseProperties has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function getUniverseProperties(universe, callback) {
              return (dispatch, getState) => {
                const universePayload = { tx: { to: universe.id } };
            
                async.parallel(
            Severity: Minor
            Found in src/modules/universe/actions/load-universe-info.js - About 1 hr to fix

              Function loadMarketsInfo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const loadMarketsInfo = (marketIds, callback = logError) => (
                dispatch,
                getState
              ) => {
                if (!marketIds || marketIds.length === 0) {
              Severity: Minor
              Found in src/modules/markets/actions/load-markets-info.js - About 1 hr to fix

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

                  render() {
                    const s = this.state;
                
                    return (
                      <section

                  Function createCategoricalMarket has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const createCategoricalMarket = async (outcomeNum: number) => {
                    // page.on('console', msg => console.log('PAGE LOG:', msg.text()));
                    const currentTimestamp: number = await page.evaluate(() =>
                      window.integrationHelpers.getCurrentTimestamp()
                    );
                  Severity: Minor
                  Found in integration/helpers/create-markets.ts - About 1 hr to fix

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        const {
                          claimTradingProceeds,
                          closedMarkets,
                          currentTimestamp,
                          history,
                    Severity: Major
                    Found in src/modules/portfolio/components/positions/positions.jsx and 3 other locations - About 1 hr to fix
                    src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 59..70
                    src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 88..99
                    src/modules/notifications/components/notification/notification.jsx on lines 33..44

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        const {
                          id,
                          description,
                          linkPath,
                          onClick,
                    src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 59..70
                    src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 88..99
                    src/modules/portfolio/components/positions/positions.jsx on lines 32..43

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                      shouldComponentUpdate(nextProps, nextState) {
                        const updateBlock = createBigNumber(this.state.blockNumber);
                        const currentBlock = createBigNumber(nextProps.currentBlockNumber);
                        if (currentBlock.gt(updateBlock)) return true;
                        return false;
                    src/modules/forking/components/fork-migration-totals/fork-migration-totals.jsx on lines 80..85

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        const {
                          pricePrecision,
                          marketDepth,
                          marketMax,
                          marketMin,
                    src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 88..99
                    src/modules/notifications/components/notification/notification.jsx on lines 33..44
                    src/modules/portfolio/components/positions/positions.jsx on lines 32..43

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                          const marketsData2 = {
                            "0x0131d98e878803e113e2accc457ad57f5b97a87910be31d60e931c08ca4d5ef1": {
                              id: 1,
                              outcomeId: "an outcomeId",
                              details: {
                    Severity: Major
                    Found in src/modules/markets/reducers/markets-data.test.js and 2 other locations - About 1 hr to fix
                    src/modules/markets/reducers/markets-data.test.js on lines 188..203
                    src/modules/markets/reducers/markets-data.test.js on lines 204..219

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 5 locations. Consider refactoring.
                    Open

                          jest
                            .spyOn(augurjs.augur.events, "startAugurNodeEventListeners")
                            .mockImplementation(listeners =>
                              listeners.InitialReporterRedeemed(null, {
                                eventName: "InitialReporterRedeemed",
                    Severity: Major
                    Found in src/modules/events/actions/listen-to-updates.test.js and 4 other locations - About 1 hr to fix
                    src/modules/events/actions/listen-to-updates.test.js on lines 287..296
                    src/modules/events/actions/listen-to-updates.test.js on lines 306..315
                    src/modules/events/actions/listen-to-updates.test.js on lines 449..458
                    src/modules/events/actions/listen-to-updates.test.js on lines 516..525

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 5 locations. Consider refactoring.
                    Open

                          jest
                            .spyOn(augurjs.augur.events, "startAugurNodeEventListeners")
                            .mockImplementation(listeners =>
                              listeners.TokensTransferred(null, {
                                eventName: "TokensTransferred",
                    Severity: Major
                    Found in src/modules/events/actions/listen-to-updates.test.js and 4 other locations - About 1 hr to fix
                    src/modules/events/actions/listen-to-updates.test.js on lines 287..296
                    src/modules/events/actions/listen-to-updates.test.js on lines 306..315
                    src/modules/events/actions/listen-to-updates.test.js on lines 423..432
                    src/modules/events/actions/listen-to-updates.test.js on lines 449..458

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                          const curMarketsData2 = {
                            "0x0131d98e878803e113e2accc457ad57f5b97a87910be31d60e931c08ca4d5ef1": {
                              id: 1,
                              outcomeId: "an outcomeId",
                              details: {
                    Severity: Major
                    Found in src/modules/markets/reducers/markets-data.test.js and 2 other locations - About 1 hr to fix
                    src/modules/markets/reducers/markets-data.test.js on lines 163..178
                    src/modules/markets/reducers/markets-data.test.js on lines 204..219

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                          const expectedOutput = {
                            "0x0131d98e878803e113e2accc457ad57f5b97a87910be31d60e931c08ca4d5ef1": {
                              id: 1,
                              outcomeId: "an outcomeId",
                              details: {
                    Severity: Major
                    Found in src/modules/markets/reducers/markets-data.test.js and 2 other locations - About 1 hr to fix
                    src/modules/markets/reducers/markets-data.test.js on lines 163..178
                    src/modules/markets/reducers/markets-data.test.js on lines 188..203

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 5 locations. Consider refactoring.
                    Open

                          jest
                            .spyOn(augurjs.augur.events, "startAugurNodeEventListeners")
                            .mockImplementation(listeners =>
                              listeners.InitialReporterRedeemed(null, {
                                eventName: "InitialReporterRedeemed",
                    Severity: Major
                    Found in src/modules/events/actions/listen-to-updates.test.js and 4 other locations - About 1 hr to fix
                    src/modules/events/actions/listen-to-updates.test.js on lines 287..296
                    src/modules/events/actions/listen-to-updates.test.js on lines 306..315
                    src/modules/events/actions/listen-to-updates.test.js on lines 423..432
                    src/modules/events/actions/listen-to-updates.test.js on lines 516..525

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 5 locations. Consider refactoring.
                    Open

                          jest
                            .spyOn(augurjs.augur.events, "startAugurNodeEventListeners")
                            .mockImplementationOnce(listeners =>
                              listeners.InitialReportSubmitted(null, {
                                eventName: "InitialReportSubmitted",
                    Severity: Major
                    Found in src/modules/events/actions/listen-to-updates.test.js and 4 other locations - About 1 hr to fix
                    src/modules/events/actions/listen-to-updates.test.js on lines 306..315
                    src/modules/events/actions/listen-to-updates.test.js on lines 423..432
                    src/modules/events/actions/listen-to-updates.test.js on lines 449..458
                    src/modules/events/actions/listen-to-updates.test.js on lines 516..525

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language