AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  render() {
    const { isMobile, mobileMenuState, subMenuScalar } = this.props;
    const showMainMenu = mobileMenuState >= mobileMenuStates.FIRSTMENU_OPEN;
    const showSubMenu = mobileMenuState === mobileMenuStates.SUBMENU_OPEN;

Severity: Minor
Found in src/modules/app/components/inner-nav/base-inner-nav.jsx - About 1 hr to fix

    Function buildCreateMarket has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const buildCreateMarket = (
      newMarket,
      isEstimate,
      universe,
      loginAccount,
    Severity: Minor
    Found in src/modules/markets/helpers/build-create-market.js - About 1 hr to fix

      Function componentWillUpdate has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        componentWillUpdate(nextProps, nextState) {
          if (this.props.isConnected !== nextProps.isConnected)
            this.props.loadMarkets();
          if (
            this.state.lowerBound !== nextState.lowerBound ||
      Severity: Minor
      Found in src/modules/reporting/components/common/disputing-markets.jsx - About 1 hr to fix

        Function validateStake has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          validateStake(rawStakeObj) {
            const { updateState } = this.props;
            const updatedValidations = { ...this.state.validations };
            let completeStakeObj = rawStakeObj;
            const maxInfo = this.calculateMaxRep(this.state.selectedOutcome);

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

              const {
                isMobile,
                market,
                marketQuantity,
                marketType,
          src/modules/portfolio/components/positions-markets-list/positions-markets-list.jsx on lines 81..94
          src/modules/trading/components/trading/trading.jsx on lines 95..108

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

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

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

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

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

          Refactorings

          Further Reading

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

              const {
                markets,
                location,
                history,
                positionsDefault,
          src/modules/trading/components/trading--form/trading--form.jsx on lines 389..402
          src/modules/trading/components/trading/trading.jsx on lines 95..108

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

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

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

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

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

          Refactorings

          Further Reading

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

              const {
                availableFunds,
                clearTradeInProgress,
                closeModal,
                isLogged,
          Severity: Major
          Found in src/modules/trading/components/trading/trading.jsx and 2 other locations - About 1 hr to fix
          src/modules/portfolio/components/positions-markets-list/positions-markets-list.jsx on lines 81..94
          src/modules/trading/components/trading--form/trading--form.jsx on lines 389..402

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

          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 t4 = {
              description: `All loading is true`,
              assertions: () => {
                const value = {
                  marketId2: MARKET_FULLY_LOADING,
          Severity: Major
          Found in src/modules/markets/selectors/is-loading.test.js and 1 other location - About 1 hr to fix
          src/modules/markets/selectors/is-loading.test.js on lines 20..32

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

          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

              describe("CROWDSOURCING_DISPUTE", () => {
                test("should be passed to callback passed to action", () => {
                  augur.augurNode.submitRequest.mock.calls[0][2](error);
                  expect(callback).toHaveBeenCalledWith(error);
                });
          Severity: Major
          Found in src/modules/reports/actions/load-disputing.test.js and 1 other location - About 1 hr to fix
          src/modules/reports/actions/load-disputing.test.js on lines 59..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 72.

          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

                next =>
                  augur.augurNode.submitRequest(
                    "getMarkets",
                    {
                      reportingState: constants.REPORTING_STATE.AWAITING_NEXT_WINDOW,
          Severity: Major
          Found in src/modules/reports/actions/load-disputing.js and 1 other location - About 1 hr to fix
          src/modules/reports/actions/load-disputing.js on lines 18..31

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

          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

                next =>
                  augur.augurNode.submitRequest(
                    "getMarkets",
                    {
                      reportingState: constants.REPORTING_STATE.CROWDSOURCING_DISPUTE,
          Severity: Major
          Found in src/modules/reports/actions/load-disputing.js and 1 other location - About 1 hr to fix
          src/modules/reports/actions/load-disputing.js on lines 32..44

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 72.

          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

              describe("AWAITING_NEXT_WINDOW", () => {
                test("should be passed to callback passed to action", () => {
                  augur.augurNode.submitRequest.mock.calls[1][2](error);
                  expect(callback).toHaveBeenCalledWith(error);
                });
          Severity: Major
          Found in src/modules/reports/actions/load-disputing.test.js and 1 other location - About 1 hr to fix
          src/modules/reports/actions/load-disputing.test.js on lines 52..57

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

          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 t2 = {
              description: `Non loading is false`,
              assertions: () => {
                const value = {
                  marketId: MARKET_INFO_LOADED,
          Severity: Major
          Found in src/modules/markets/selectors/is-loading.test.js and 1 other location - About 1 hr to fix
          src/modules/markets/selectors/is-loading.test.js on lines 49..61

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

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

          export default function(authForm) {
            expect(authForm).toBeDefined();
            expect(typeof authForm).toBe("object");
          
            expect(authForm.closeLink).toBeDefined();
          Severity: Minor
          Found in src/assertions/auth-form.js - About 1 hr to fix

            Function assertAccountReport has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function assertAccountReport(report) {
              describe(`report's shape`, () => {
                test("id", () => {
                  expect(report.id).toBeDefined();
                  expect(typeof report.id).toBe("string");
            Severity: Minor
            Found in src/assertions/my-reports.js - About 1 hr to fix

              Function mousemove has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function mousemove() {
                    const { data } = selectedSeriesData[0];
                    const v2 = x.invert(d3.mouse(this)[0]);
                    const biSect = d3.bisector(d => d[0]).left;
                    let i = biSect(data, v2, 0);

                Function attachHoverClickHandlers has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function attachHoverClickHandlers(options) {
                  const {
                    drawParams,
                    depthChart,
                    marketDepth,

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

                    const t3 = {
                      description: "Returns the expected object for updating isMobileSmall",
                      statusKey: IS_MOBILE_SMALL,
                      value: true,
                      assertions: action => {
                  Severity: Major
                  Found in src/modules/app/actions/update-app-status.test.js and 4 other locations - About 1 hr to fix
                  src/modules/app/actions/update-app-status.test.js on lines 12..25
                  src/modules/app/actions/update-app-status.test.js on lines 27..40
                  src/modules/app/actions/update-app-status.test.js on lines 57..70
                  src/modules/app/actions/update-app-status.test.js on lines 72..85

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 71.

                  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 t5 = {
                      description: "Returns the expected object for updating transactionsLoading",
                      statusKey: TRANSACTIONS_LOADING,
                      value: true,
                      assertions: action => {
                  Severity: Major
                  Found in src/modules/app/actions/update-app-status.test.js and 4 other locations - About 1 hr to fix
                  src/modules/app/actions/update-app-status.test.js on lines 12..25
                  src/modules/app/actions/update-app-status.test.js on lines 27..40
                  src/modules/app/actions/update-app-status.test.js on lines 42..55
                  src/modules/app/actions/update-app-status.test.js on lines 57..70

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

                  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

                    static propTypes = {
                      marketId: PropTypes.string.isRequired,
                      marketDescription: PropTypes.string.isRequired,
                      migrateMarketThroughFork: PropTypes.func.isRequired,
                      closeModal: PropTypes.func.isRequired,
                  Severity: Major
                  Found in src/modules/modal/components/modal-migrate-market.jsx and 3 other locations - About 1 hr to fix
                  src/modules/create-market/components/create-market-form-outcome/create-market-form-outcome.jsx on lines 35..41
                  src/modules/create-market/components/create-market-form-resolution/create-market-form-resolution.jsx on lines 19..25
                  src/modules/modal/components/modal-market-review.jsx on lines 10..16

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

                  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