AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  chart
    .append("g")
    .selectAll("line")
    .data(ticks)
    .enter()
src/modules/market-charts/components/market-outcomes-chart/market-outcomes-chart.jsx on lines 314..321

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

  augur.markets.getMarketPriceHistory(options, (err, priceHistory) => {
    if (err) return callback(err);
    if (priceHistory == null) return callback(null);
    dispatch(updateMarketPriceHistory(options.marketId, priceHistory));
    callback(null, priceHistory);
Severity: Major
Found in src/modules/markets/actions/price-history-management.js and 1 other location - About 1 hr to fix
src/modules/markets/actions/market-trading-history-management.js on lines 30..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 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.volume")
    .data(priceTimeSeries)
    .enter()
    .append("rect")
src/modules/market-charts/components/market-outcome-charts--candlestick/market-outcome-charts--candlestick.jsx on lines 519..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 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 = {
    universe: PropTypes.string.isRequired,
    currentAugurTimestamp: PropTypes.number.isRequired,
    getProfitLoss: PropTypes.func.isRequired,
    isAnimating: PropTypes.bool.isRequired
src/modules/market-charts/components/market-outcome-charts--candlestick-period-selector/market-outcome-charts--candlestick-period-selector.jsx on lines 13..18

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

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

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

                                const {
                                  openOrders,
                                  positions,
                                  numCompleteSets,
                                  transactionsStatus,
                            src/modules/app/components/app/app.jsx on lines 214..224
                            src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 241..251
                            src/modules/markets-list/components/markets-header/markets-header.jsx on lines 71..81
                            src/modules/reporting/components/reporting-report-form/reporting-report-form.jsx on lines 177..187

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

                            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

                                const {
                                  filter,
                                  sort,
                                  maxFee,
                                  maxSpreadPercent,
                            src/modules/app/components/app/app.jsx on lines 214..224
                            src/modules/market-charts/components/market-outcome-charts--depth/market-outcome-charts--depth.jsx on lines 241..251
                            src/modules/market/components/market-positions-list/market-positions-list.jsx on lines 49..59
                            src/modules/reporting/components/reporting-report-form/reporting-report-form.jsx on lines 177..187

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

                            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

                                const {
                                  pricePrecision,
                                  marketDepth,
                                  marketMax,
                                  marketMin,
                            src/modules/app/components/app/app.jsx on lines 214..224
                            src/modules/market/components/market-positions-list/market-positions-list.jsx on lines 49..59
                            src/modules/markets-list/components/markets-header/markets-header.jsx on lines 71..81
                            src/modules/reporting/components/reporting-report-form/reporting-report-form.jsx on lines 177..187

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

                            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