AugurProject/augur-ui

View on GitHub

Showing 1,757 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

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

                  describe("when only the same ethereum-node-ws is passed", () => {
                    test("should not update location", () => {
                      editEndpointParams(windowRef, {
                        ethereumNodeWS: "ws://127.0.0.1:8546"
                      });
              Severity: Major
              Found in src/utils/edit-endpoint-params.test.js and 2 other locations - About 1 hr to fix
              src/utils/edit-endpoint-params.test.js on lines 35..40
              src/utils/edit-endpoint-params.test.js on lines 42..49

              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 58.

              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

                    drawXAxisLabels({
                      priceTimeSeries,
                      candleChart,
                      containerWidth,
                      containerHeight,
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 255..266
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 268..279

              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 58.

              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

                    drawCandles({
                      boundDiff,
                      candleChart,
                      candleDim,
                      chartDim,
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 268..279
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 283..294

              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 58.

              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

                  describe("when only the same ethereum-node-http is passed", () => {
                    test("should not update location", () => {
                      editEndpointParams(windowRef, {
                        ethereumNodeHTTP: "http://127.0.0.1:8545"
                      });
              Severity: Major
              Found in src/utils/edit-endpoint-params.test.js and 2 other locations - About 1 hr to fix
              src/utils/edit-endpoint-params.test.js on lines 35..40
              src/utils/edit-endpoint-params.test.js on lines 51..58

              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 58.

              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

                  describe("when only the same augur-node is passed", () => {
                    test("should not update location", () => {
                      editEndpointParams(windowRef, { augurNode: "ws://127.0.0.1:9001" });
                      expect(spy.called).toBeFalsy();
                    });
              Severity: Major
              Found in src/utils/edit-endpoint-params.test.js and 2 other locations - About 1 hr to fix
              src/utils/edit-endpoint-params.test.js on lines 42..49
              src/utils/edit-endpoint-params.test.js on lines 51..58

              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 58.

              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

                    drawVolume({
                      boundDiff,
                      candleChart,
                      candleDim,
                      chartDim,
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 255..266
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 283..294

              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 58.

              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 2 locations. Consider refactoring.
              Open

                  (err, tradingHistory) => {
                    if (err) return callback(err);
                    if (tradingHistory == null) return callback(null);
                    dispatch(updateMarketTradingHistory(options.marketId, tradingHistory));
                    callback(null, tradingHistory);
              src/modules/markets/actions/price-history-management.js on lines 20..25

              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 58.

              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 2 locations. Consider refactoring.
              Open

                        <div className={Styles.notificationBar_container}>
                          <Link
                            to={makePath(MY_POSITIONS)}
                            className={Styles.notificationBar_button}
                          >
              src/modules/notifications/components/notification-bar/notification-bar.jsx on lines 83..90

              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 58.

              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 2 locations. Consider refactoring.
              Open

              const ValueDenomination = ({
                className,
                prefix,
                hidePrefix,
                formatted,
              src/modules/portfolio/components/market-portfolio-card/market-portfolio-card-footer.jsx on lines 15..127

              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 58.

              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 2 locations. Consider refactoring.
              Open

                chart
                  .append("g")
                  .selectAll("text")
                  .data(ticks)
                  .enter()
              src/modules/market-charts/components/market-outcomes-chart/market-outcomes-chart.jsx on lines 298..308

              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 58.

              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 2 locations. Consider refactoring.
              Open

                        <div className={Styles.notificationBar_containerView}>
                          <Link
                            to={makePath(MY_POSITIONS)}
                            className={Styles.notificationBar_button}
                          >
              src/modules/notifications/components/notification-bar/notification-bar.jsx on lines 57..64

              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 58.

              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 2 locations. Consider refactoring.
              Open

              const MarketPortfolioCardFooter = ({
                currentTimestamp,
                finalizationTime,
                linkType,
                unclaimedForkEth,
              src/modules/common/components/value-denomination/value-denomination.jsx on lines 6..54

              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 58.

              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 2 locations. Consider refactoring.
              Open

                static propTypes = {
                  updateSelectedPeriod: PropTypes.func.isRequired,
                  updateSelectedRange: PropTypes.func.isRequired,
                  selectedPeriod: PropTypes.number.isRequired,
                  selectedRange: PropTypes.number.isRequired
              src/modules/portfolio/components/performance-graph/performance-graph.jsx on lines 10..15

              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 58.

              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 2 locations. Consider refactoring.
              Open

                  candleChart
                    .selectAll("rect.candle")
                    .data(priceTimeSeries)
                    .enter()
                    .append("rect")
              src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 566..572

              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 58.

              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