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

        <div className={Styles.TransactionMetaSubsectionContainer}>
          <div className={Styles.TransactionMetaSubsectionHeader}>OPENED</div>
          <div className={Styles.TransactionMetaSubsection}>
            <ul className={Styles.TransactionMeta}>
              <li>
src/modules/portfolio/components/transaction-meta/transaction-meta.jsx on lines 55..77

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

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.TransactionMetaSubsectionContainer}>
            <div className={Styles.TransactionMetaSubsectionHeader}>
              CANCELED
            </div>
            <div className={Styles.TransactionMetaSubsection}>
src/modules/portfolio/components/transaction-meta/transaction-meta.jsx on lines 33..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 212.

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

File set-notification-text.js has 533 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @todo Update text for FINALIZE once notification triggering is moved
 */
import { augur } from "services/augurjs";
import { isEmpty } from "lodash/fp";
Severity: Major
Found in src/modules/notifications/actions/set-notification-text.js - About 1 day to fix

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

      render() {
        const p = this.props;
        const {
          marketType,
          openInterest,
    Severity: Major
    Found in src/modules/market/components/market-properties/market-properties.jsx - About 1 day to fix

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

            } else if (selectedSide === BID) {
              // Minimum Price
              minPrice = ZERO;
      
              // Maximum Price
      src/modules/create-market/components/create-market-form-liquidity/create-market-form-liquidity.jsx on lines 212..244

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

      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

              if (selectedSide === BID) {
                // Minimum Price
                minPrice = scalarSmallNum;
      
                // Maximum Price
      src/modules/create-market/components/create-market-form-liquidity/create-market-form-liquidity.jsx on lines 245..277

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

      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

      File listen-to-updates.test.js has 505 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { listenToUpdates } from "modules/events/actions/listen-to-updates";
      import * as augurjs from "services/augurjs";
      import * as loadMarketsInfoModule from "modules/markets/actions/load-markets-info";
      import * as loadUnclaimedFeesModule from "modules/markets/actions/market-creator-fees-management";
      import * as convertLogsToTransactionsModule from "modules/transactions/actions/convert-logs-to-transactions";
      Severity: Major
      Found in src/modules/events/actions/listen-to-updates.test.js - About 1 day to fix

        File market.js has 504 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
        This is one of the most important and sensitive selectors in the app.
        It builds the fat, heavy, rigid, hierarchical market objects,
        that are used to render and display many parts of the ui.
        This is the point where the shallow, light, loose, flexible, independent
        Severity: Major
        Found in src/modules/markets/selectors/market.js - About 1 day to fix

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

                    <li
                      className={
                        marketType === YES_NO
                          ? Styles["TradingForm__button__yes_no--review"]
                          : Styles["TradingForm__button--review"]
          src/modules/trading/components/trading--form/trading--form.jsx on lines 619..655

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

          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

                      <li
                        className={
                          marketType === YES_NO
                            ? Styles["TradingForm__button__yes_no--review"]
                            : Styles["TradingForm__button--review"]
          src/modules/trading/components/trading--form/trading--form.jsx on lines 475..511

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

          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 render has 200 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { newMarket } = this.props;
              const s = this.state;
          
              return (

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

            export const Trezor = (
              <svg
                width="13px"
                height="18px"
                viewBox="0 0 13 18"
            Severity: Major
            Found in src/modules/common/components/icons.jsx and 1 other location - About 7 hrs to fix
            src/modules/common/components/icons.jsx on lines 168..201

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

            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

            export const Edge = (
              <svg
                width="18px"
                height="18px"
                viewBox="0 0 18 18"
            Severity: Major
            Found in src/modules/common/components/icons.jsx and 1 other location - About 7 hrs to fix
            src/modules/common/components/icons.jsx on lines 232..265

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

            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

            export default function(
              participationTokensData = DEFAULT_STATE,
              { type, data }
            ) {
              switch (type) {
            Severity: Major
            Found in src/modules/reports/reducers/participation-token-data.js and 2 other locations - About 7 hrs to fix
            src/modules/reports/reducers/dispute-crowdsourcer-data.js on lines 9..46
            src/modules/reports/reducers/initial-reporters-data.js on lines 9..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 188.

            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

            export default function(initialReportersData = DEFAULT_STATE, { type, data }) {
              switch (type) {
                case UPDATE_INITIAL_REPORTERS_DATA: {
                  const { initialReportersDataUpdated } = data;
                  const updatedInitialReporters = Object.keys(
            Severity: Major
            Found in src/modules/reports/reducers/initial-reporters-data.js and 2 other locations - About 7 hrs to fix
            src/modules/reports/reducers/dispute-crowdsourcer-data.js on lines 9..46
            src/modules/reports/reducers/participation-token-data.js on lines 9..46

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

            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

            export default function(
              disputeCrowdsourcersData = DEFAULT_STATE,
              { type, data }
            ) {
              switch (type) {
            Severity: Major
            Found in src/modules/reports/reducers/dispute-crowdsourcer-data.js and 2 other locations - About 7 hrs to fix
            src/modules/reports/reducers/initial-reporters-data.js on lines 9..43
            src/modules/reports/reducers/participation-token-data.js on lines 9..46

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

            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

            File add-transactions.js has 485 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              MARKET_CREATION,
              PUBLIC_TRADE,
              TRANSFER,
              REPORTING,
            Severity: Minor
            Found in src/modules/transactions/actions/add-transactions.js - About 7 hrs to fix

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

                render() {
                  const {
                    openOrders,
                    positions,
                    numCompleteSets,

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

                  test("unlocked ethereum node", () => {
                    const store = mockStore();
                    augur.rpc.clear.mockImplementation(() =>
                      store.dispatch({ type: "AUGURJS_RPC_CLEAR" })
                    );
                src/modules/auth/actions/update-is-logged-and-load-account-data.test.js on lines 59..86

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

                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

                  test("metamask-connect", () => {
                    const store = mockStore();
                    augur.rpc.clear.mockImplementation(() =>
                      store.dispatch({ type: "AUGURJS_RPC_CLEAR" })
                    );
                src/modules/auth/actions/update-is-logged-and-load-account-data.test.js on lines 25..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 186.

                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