AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  render() {
    const { history, location, markets, marketIds } = this.props;
    const { designated, open, upcoming } = markets;
    const { paginations, PAGINATION_LENGTH } = this.state;

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

      render() {
        const {
          isLogged,
          isMobile,
          loadMarketsInfoIfNotLoaded,

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

        render() {
          const { newMarket } = this.props;
          const { outcomes } = newMarket;
          const cleanedOutcomes = outcomes.filter(outcome => outcome !== "");
          const totalOutcomes = cleanedOutcomes.length;

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

          render() {
            const {
              markets,
              location,
              history,

          Function trezorSigner has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const trezorSigner = async (connect, path, dispatch, rawTxArgs) => {
            function hex(num) {
              let str = prefixHex(num).slice(2);
              if (str.length % 2 !== 0) str = "0" + str;
              return str;
          Severity: Minor
          Found in src/modules/auth/helpers/trezor-signer.js - About 2 hrs to fix

            Function drawTicks has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function drawTicks(options) {
              const { drawParams, chart, pricePrecision } = options;
            
              // Y axis
              //  Bounds

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

                render() {
                  const { options, alignLeft } = this.props;
                  return (
                    <div
                      className={Styles.Dropdown}
              Severity: Minor
              Found in src/modules/common/components/dropdown/dropdown.jsx - About 2 hrs to fix

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

                  validations: [
                    {
                      description: null,
                      category: null,
                      tag1: "",
                Severity: Major
                Found in src/modules/markets/reducers/new-market.js and 2 other locations - About 2 hrs to fix
                src/modules/markets/reducers/new-market.test.js on lines 45..63
                src/modules/markets/reducers/new-market.test.js on lines 420..438

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

                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

                Function updateInitialLiquidityCosts has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  updateInitialLiquidityCosts(order, shouldReduce) {
                    const { availableEth, newMarket, updateNewMarket } = this.props;
                    const minPrice = newMarket.type === SCALAR ? newMarket.scalarSmallNum : 0;
                    const maxPrice = newMarket.type === SCALAR ? newMarket.scalarBigNum : 1;
                    const shareBalances = newMarket.outcomes.map(outcome => 0);

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

                        validations: [
                          {
                            description: null,
                            category: null,
                            tag1: "",
                  Severity: Major
                  Found in src/modules/markets/reducers/new-market.test.js and 2 other locations - About 2 hrs to fix
                  src/modules/markets/reducers/new-market.js on lines 15..33
                  src/modules/markets/reducers/new-market.test.js on lines 45..63

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

                  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

                    const marketBinary = {
                      maxPrice: 100,
                      minPrice: 0,
                      numTicks: 10000,
                      numOutcomes: 2,
                  src/modules/reports/selectors/select-migrated-totals.test.js on lines 13..24

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

                  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

                    const marketBinary = {
                      maxPrice: 100,
                      minPrice: 0,
                      numTicks: 10000,
                      numOutcomes: 2,
                  Severity: Major
                  Found in src/modules/reports/selectors/select-migrated-totals.test.js and 1 other location - About 2 hrs to fix
                  src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 24..35

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

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

                        validations: [
                          {
                            description: null,
                            category: null,
                            tag1: "",
                  Severity: Major
                  Found in src/modules/markets/reducers/new-market.test.js and 2 other locations - About 2 hrs to fix
                  src/modules/markets/reducers/new-market.js on lines 15..33
                  src/modules/markets/reducers/new-market.test.js on lines 420..438

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

                  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
                            ref={confirmMessage => {
                              this.confirmMessage = confirmMessage;
                            }}
                            className={classNames(Styles.MobileOrder__confirm, {
                  src/modules/market/components/market-positions-list--order/market-positions-list--order.jsx on lines 136..170

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

                  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
                            ref={confirmMessage => {
                              this.confirmMessage = confirmMessage;
                            }}
                            className={classNames(Styles.Order__confirm, {
                  src/modules/market/components/market-positions-list--mobile-order/market-positions-list--mobile-order.jsx on lines 86..109

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

                  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

                    selectPeriod(period) {
                      const { selectedPeriod, updateSelectedPeriod } = this.props;
                  
                      updateSelectedPeriod(
                        period.duration === selectedPeriod ? -1 : period.duration
                  src/modules/market-charts/components/market-outcome-charts--candlestick-period-selector/market-outcome-charts--candlestick-period-selector.jsx on lines 46..53

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

                  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

                    selectRange(range) {
                      const { selectedRange, updateSelectedRange } = this.props;
                  
                      updateSelectedRange(range.duration === selectedRange ? -1 : range.duration);
                      this.setState({
                  src/modules/market-charts/components/market-outcome-charts--candlestick-period-selector/market-outcome-charts--candlestick-period-selector.jsx on lines 55..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 75.

                  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

                      store.dispatch(
                        loadOneOutcomeBidsOrAsks(
                          params.marketId,
                          params.outcome,
                          params.orderTypeLabel,
                  src/modules/orders/actions/load-one-outcome-bids-or-asks.test.js on lines 61..73
                  src/modules/orders/actions/load-one-outcome-bids-or-asks.test.js on lines 83..95
                  src/modules/orders/actions/load-one-outcome-bids-or-asks.test.js on lines 105..115

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

                  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

                      store.dispatch(
                        loadOneOutcomeBidsOrAsks(
                          params.marketId,
                          params.outcome,
                          params.orderTypeLabel,
                  src/modules/orders/actions/load-one-outcome-bids-or-asks.test.js on lines 39..51
                  src/modules/orders/actions/load-one-outcome-bids-or-asks.test.js on lines 61..73
                  src/modules/orders/actions/load-one-outcome-bids-or-asks.test.js on lines 83..95

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

                  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

                    nextPage() {
                      this.setState({
                        currentStep: this.state.currentStep >= 1 ? 1 : this.state.currentStep + 1
                      });
                      this.calculateGasEstimates(this.props.gasPrice);
                  src/modules/reporting/components/reporting-report/reporting-report.jsx on lines 92..97

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

                  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