AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  render() {
    const { closeModal, handleAction, market } = this.props;
    const { didCheck } = this.state;

    const showReadMore = market.details && market.details.length > 126;
Severity: Major
Found in src/modules/modal/components/modal-market-review.jsx - About 4 hrs to fix

    Function setCurrentSegment has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      setCurrentSegment(options) {
        if (!options.itemsLength) return options.setSegment([]);
    
        const currentPage = parseInt(
          parseQuery(options.location.search)[options.pageParam] || 1,
    Severity: Major
    Found in src/modules/common/components/paginator/paginator.jsx - About 4 hrs to fix

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

        render() {
          const {
            isExtendedDisplay,
            isMobile,
            outcomeName,

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

                                        <div
                                          className={Styles.ReportingHeader__column}
                                          style={{ marginRight: "30px" }}
                                        >
                                          <div
        src/modules/reporting/components/reporting-header/reporting-header.jsx on lines 240..271

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

        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 handleEthereumDisconnect = (history, event) => (
          dispatch,
          getState
        ) => {
          console.warn("Disconnected from Ethereum", event);
        Severity: Major
        Found in src/modules/events/actions/disconnect-handlers.js and 1 other location - About 4 hrs to fix
        src/modules/events/actions/disconnect-handlers.js on lines 9..22

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

        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 handleAugurNodeDisconnect = (history, event) => (
          dispatch,
          getState
        ) => {
          console.warn("Disconnected from augur-node", event);
        Severity: Major
        Found in src/modules/events/actions/disconnect-handlers.js and 1 other location - About 4 hrs to fix
        src/modules/events/actions/disconnect-handlers.js on lines 24..37

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

        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.ReportingHeader__column}
                                          style={{ marginRight: "30px" }}
                                        >
                                          <div
        src/modules/reporting/components/reporting-header/reporting-header.jsx on lines 208..239

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

        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 function claimReportingFeesForkedMarket(options, callback = logError) {
          return (dispatch, getState) => {
            const { loginAccount } = getState();
            const payload = {
              ...options,
        Severity: Major
        Found in src/modules/reports/actions/claim-reporting-fees.js and 1 other location - About 3 hrs to fix
        src/modules/reports/actions/claim-reporting-fees.js on lines 19..38

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

        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 function claimReportingFeesNonforkedMarkets(
          options,
          callback = logError
        ) {
          return (dispatch, getState) => {
        Severity: Major
        Found in src/modules/reports/actions/claim-reporting-fees.js and 1 other location - About 3 hrs to fix
        src/modules/reports/actions/claim-reporting-fees.js on lines 4..17

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

        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 format-number.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { BigNumber, createBigNumber } from "utils/create-big-number";
        import {
          encodeNumberAsBase10String,
          encodeNumberAsJSNumber,
          unfix
        Severity: Minor
        Found in src/utils/format-number.js - About 3 hrs to fix

          Function loadReporting has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const loadReporting = (marketIdsParam, callback = logError) => (
            dispatch,
            getState
          ) => {
            const { universe, loginAccount } = getState();
          Severity: Major
          Found in src/modules/reports/actions/load-reporting.js - About 3 hrs to fix

            Function render has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

              render() {
                const {
                  currentTimestamp,
                  isMobile,
                  linkType,

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

            export default function(keywords) {
              expect(keywords).toBeDefined();
              expect(typeof keywords).toBe("object");
              expect(keywords.value).toBeDefined();
              expect(typeof keywords.value).toBe("string");
            Severity: Major
            Found in src/assertions/keywords.js and 1 other location - About 3 hrs to fix
            src/assertions/search-sort.js on lines 10..17

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

            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

            function assertionSelectedSort(actual) {
              expect(actual).toBeDefined();
              expect(typeof actual).toBe("object");
              expect(actual.prop).toBeDefined();
              expect(typeof actual.prop).toBe("string");
            Severity: Major
            Found in src/assertions/search-sort.js and 1 other location - About 3 hrs to fix
            src/assertions/keywords.js on lines 1..8

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

            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

                  {
                    data: {
                      id: "0xMARKETID",
                      outcomeName: "test outcome"
                    },
            Severity: Major
            Found in src/modules/transactions/selectors/transactions.test.js and 2 other locations - About 3 hrs to fix
            src/modules/transactions/selectors/transactions.test.js on lines 169..187
            src/modules/transactions/selectors/transactions.test.js on lines 188..206

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

            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

                      {
                        data: {
                          id: "0xMARKETID",
                          outcomeName: "test outcome"
                        },
            Severity: Major
            Found in src/modules/transactions/selectors/transactions.test.js and 2 other locations - About 3 hrs to fix
            src/modules/transactions/selectors/transactions.test.js on lines 144..162
            src/modules/transactions/selectors/transactions.test.js on lines 188..206

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

            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

                      {
                        data: {
                          id: "0xMARKETID",
                          outcomeName: "test outcome"
                        },
            Severity: Major
            Found in src/modules/transactions/selectors/transactions.test.js and 2 other locations - About 3 hrs to fix
            src/modules/transactions/selectors/transactions.test.js on lines 144..162
            src/modules/transactions/selectors/transactions.test.js on lines 169..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 113.

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

              render() {
                const { address, openZeroExInstant, augurNodeNetworkId } = this.props;
                const styleQR = {
                  height: "auto",
                  width: "100%"
            Severity: Major
            Found in src/modules/account/components/account-deposit/account-deposit.jsx - About 3 hrs to fix

              File filter-dropdowns.jsx has 328 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Component } from "react";
              import PropTypes from "prop-types";
              import {
                MARKET_VOLUME,
                MARKET_CREATION_TIME,

                File input.jsx has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { Component } from "react";
                import PropTypes from "prop-types";
                import classNames from "classnames";
                import { BigNumber, createBigNumber } from "utils/create-big-number";
                import { PulseLoader } from "react-spinners";
                Severity: Minor
                Found in src/modules/common/components/input/input.jsx - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language